---
name: "upterm-session-ssh-config"
section: "1"
platform: "linux"
package: "upterm"
version: "0.41.0-1"
release: "Arch Linux 2026-11-07"
platforms: ["linux"]
url: "https://carta.tech/man/upterm-session-ssh-config"
---

# upterm-session-ssh-config(1)

Print the ssh config that reaches a session

## NAME

upterm-session-ssh-config - Print the ssh config that reaches a session

## SYNOPSIS

**upterm session ssh-config NAME\|ID \[flags\]**

## DESCRIPTION

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.

## EXAMPLE

```
  # 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
```

## SEE ALSO

**[upterm-session(1)](/man/upterm-session/1.md)**

## HISTORY

2-Nov-2026 Auto generated by spf13/cobra
