---
sidebar_position: 13
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lium.io/llms.txt
> Use this file to discover all available pages before exploring further.

# `lium ssh`

SSH into a pod.

```bash
lium ssh TARGET
```

## Arguments

- `TARGET` — Pod name or index from [`lium ps`](./ps).

## Examples

```bash
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`](./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`. That happens after the platform restarts a pod on its own;
[`lium reboot`](./reboot) and [`lium rm`](./rm) drop the pin themselves, as do the SDK's
`edit` and `switch_template`. If you know the pod was re-provisioned, delete that file and
connect again. `LIUM_SSH_INSECURE=1` restores the old
behaviour 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`](./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`](./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

- [`lium exec`](./exec) — run a command without holding a TTY
- [`lium scp`](./scp) / [`lium rsync`](./rsync) — move files
