Skip to main content

lium ssh

SSH into a pod.

lium ssh TARGET

Arguments​

  • TARGET — Pod name or index from lium ps.

Examples​

lium ssh my-pod # Interactive shell
lium ssh 1 # SSH to pod #1

To run a one-shot command without holding a shell, use lium exec instead.

Host keys​

The pod's SSH host key is pinned on the first connection under ~/.lium/known_hosts/<pod-id> and checked on every later one, the same file the SDK's exec, stream_exec and rsync use. A pod that later presents a different key is not connected to: OpenSSH stops with its "remote host identification has changed" warning and lium ssh exits 4. Today a pod presents a new host key after the platform restarts it on its own; lium reboot and lium rm drop the pin themselves, as do the SDK's edit and switch_template.

Not released yet: a pod will keep its ed25519 host key for its whole life: a reboot, an edit or a template switch recreates the container with the same key, from the web app as well as from the CLI, so the pin (and a plain ssh known_hosts entry) stays valid. A pod created before this was in place gets its permanent key at its first reboot, once. The key belongs to the pod, not to the address: a new pod, including one restored from a backup onto another node, has a key of its own.

If you know the pod was re-provisioned, delete that file and connect again. LIUM_SSH_INSECURE=1 restores the old behavior of accepting any key.

The command runs OpenSSH with an argument list built from the pod's user, address and port; the connection string the API returns is never handed to a shell. A value of any other shape is refused before anything runs: Pod '<pod>': Unexpected ssh command from the API: …, exit 4. The session lium up opens after a rent follows the same rules.

A connection ssh itself could not make — refused or dropped — exits 4. A pod that exists but cannot take a session (stopped, failed, no SSH endpoint yet) exits 4 as well, while a TARGET matching no pod exits 5. Unlike lium exec, the remote shell's own exit code is not passed back: that is the remote's business, and the session itself succeeded.

See also​