SSH on iPhone works like SSH anywhere else. The iPhone runs the client, the machine on the other end runs an SSH server, and you log in with a password or a key. Everything heavy happens on the server; the phone shows the terminal and sends your keystrokes.
The steps use Shell Drop, a free SSH client for iPhone, iPad and iPhone Duo. The server side applies to any iOS SSH client.
sudo apt install openssh-server.ssh [email protected]. If that works, the server is ready.The first connection records the server's host key. If the key is different on a later connection, Shell Drop blocks the session and shows the mismatch. That check is what stops a connection quietly going to the wrong machine.
The SSH on iPad guide goes through the server setup and the common connection errors in more detail; it's the same on a phone.
Typing a password on a phone keyboard gets old fast. A key signs in with nothing to type.
Generate an Ed25519 key or a Secure Enclave key in Shell Drop, or paste-import an existing OpenSSH key. Any key can be set to need Face ID each time it signs in, and a Secure Enclave key's private half never leaves the chip.
The server needs the public half in ~/.ssh/authorized_keys. A phone has no ssh-copy-id, so if you can already log in with a password, use Set up a key for this server: Shell Drop creates the key, installs it on the server and switches the connection over once it works. ssh-copy-id and the alternatives covers the manual way, and SSH keys on iPhone covers key types, one key per device and agent forwarding.
On home wifi, the machine's local address (something like 192.168.1.20) works. On mobile data it won't, because a machine behind a home router has no public address.
A private network such as Tailscale fixes that. Install it on the iPhone and the server, and the server gets an address the phone can reach from any network. In Shell Drop, that address goes in the host field like any other. A non-standard SSH port goes in the port field.
A VPS with a public address is reachable directly. If it's exposed to the internet, keys only and password logins off is the usual setup (PasswordAuthentication no in /etc/ssh/sshd_config, once your key works).
Some typical jobs from a phone:
tail -f /var/log/syslog, or journalctl -u nginx -f on a systemd server.sudo systemctl restart nginx.uptime, df -h, htop.The keyboard toolbar carries the keys a phone keyboard lacks: sticky Ctrl, Esc, the arrows and a Tmux detach key. Tap Ctrl then C to stop a running command, the same as Ctrl-C on a laptop. Long output reads better with the keyboard collapsed: a double tap hides it and gives the output the whole screen.
Phones lock, switch apps and move between wifi and mobile data. Background sessions in Shell Drop keep running while you use other apps, and connections that die after a VPN switch are detected and reconnected.
The reliable layer is on the server. Start long work inside Tmux:
tmux new -A -s main
If the phone drops off completely, the session just detaches and carries on. Connect again, run the same command, and the screen is exactly as you left it. With Settings > Terminal > Tmux > Auto-attach sessions on, Shell Drop re-attaches restored tabs to their sessions by name. See Tmux attach and detach for the commands, and Tmux scrollback for scrolling back through output with a swipe.
Some servers are only reachable through a jump host. On a laptop that's ProxyJump in ~/.ssh/config (the ssh config file guide shows it). Shell Drop has no jump host setting, so connect to the bastion, then ssh onward from there. With agent forwarding on for the bastion connection, the second hop can use the key on your phone, and no private key is left on the bastion.
For what the app itself looks like on a phone (gestures, image paste, live activities for agents), see the iPhone terminal app page.
Install an SSH client such as Shell Drop, add a saved connection with the server's address, port, user name and a password or key, and tap it. The server needs SSH turned on, and a machine at home needs a VPN such as Tailscale to be reachable from mobile data.
Not on a standard iPhone. iOS doesn't run an SSH server, so the iPhone can't accept SSH connections. It works the other way round: the iPhone is the client and connects out to a Mac, a Linux machine or a VPS.
It depends on what you connect for. Shell Drop is free and built around Tmux and AI coding agents. The best SSH client for iPhone and iPad roundup compares eleven apps, including the ones with Mosh, SFTP and port forwarding.
Yes. In Shell Drop any key can be set to need Face ID, or the device passcode, each time it signs in to a server. A key made in the Secure Enclave can't be copied off the phone at all.
There is no jump host (ProxyJump) setting. Connect to the bastion, then SSH onward from there; with agent forwarding on for that connection, the second hop can use the key on your phone.