upterm-session-ssh-config(1)

upterm-session-ssh-config1

Print the ssh config that reaches a session

Usage

upterm {session ssh-config NAME | ID [flags]}

Overview

Print what ssh needs to reach a session by a name of your own, so that plain ssh, scp, sftp and VS Code (Remote-SSH) connect to it as to any other host: a Host block for ~/.ssh/config, and the relay's key for ~/.ssh/known_hosts.

Put the Host block in ~/.ssh/config on each device you connect from. Its User is the session's SSH user, which changes whenever the session restarts, and on a relay that routes by node, also when the session comes back on another node: run this again then, and replace the block. The Host is the session's name, or --alias.

Add the known_hosts lines to ~/.ssh/known_hosts on each device, once. They are the relay key this session's host trusted when it connected. When the host accepted that key on first use, with no line in its known_hosts to check it against, a comment above it says so: compare its fingerprint with the one the relay's operator publishes before you add it. With no comment above it, a line already in the host's known_hosts matched the key, which makes it only as good as that line.

The two parts go in different files: the known_hosts lines aren't ssh config, so don't append the whole output to ~/.ssh/config.

NAME|ID is the session's name (the one 'upterm host' printed, or --name gave it) or its session ID; 'upterm session list' shows both.

'upterm session info NAME -o json' has the same block as sshConfig, and the known_hosts lines as knownHosts, beside how the host came to trust the key (relayKeyTrust).

Exits 4 when no session has the name, and 1 for any other failure.

Options

--alias=""
The name to give the session in ~/.ssh/config, for ssh ALIAS (default: the session's name)

-h, --help[=false]
help for ssh-config

Options inherited from parent commands

--debug[=false]
Enable debug logging (log file: /build/.upterm/upterm.log). A non-empty DEBUG turns it on too.

Examples

  # Print the ssh config for the session named home:
  upterm session ssh-config home
  # The same session, by its session ID:
  upterm session ssh-config d3k5fia7m4us73ehblug
  # Name it laptop-home in ~/.ssh/config, for 'ssh laptop-home':
  upterm session ssh-config home --alias laptop-home

History

2-Nov-2026 Auto generated by spf13/cobra

From upterm 0.41.0-1 in Arch Linux 2026-11-07. Parsed by carta from the page's man source.