Can you SSH from an iPhone?
Yes. iOS still ships no built-in terminal, but installing an SSH client from the App Store gives you a complete SSH client in your pocket — enough to connect to a Linux server, a VPS, your Mac, or a Raspberry Pi and run real commands. No jailbreak, no computer, no developer account. It takes about five minutes the first time.
The short version, if you just want the steps:
- Install an SSH client from the App Store (TermAI, Blink Shell, Termius, Easy SSH, Prompt 3 — any of them).
- Add a connection: host (IP or hostname), port
22, and your username. - Pick authentication: password to test, an SSH key for anything you'll use again.
- Tap connect and compare the host-key fingerprint with a trusted server record before accepting it.
- Use the special-key row (Esc / Tab / Ctrl / arrows) — without it half the shell is unreachable on a phone keyboard.
The rest of this guide walks through each step with screenshots, then covers the parts that actually trip people up: Raspberry Pi defaults, reaching a machine that isn't on your Wi-Fi, iOS killing your session in the background, and the four errors you're most likely to hit. The screenshots are from TermAI, but the flow is nearly identical in any modern client.
This guide covers connecting from an iPhone to a server. It does not turn the phone into an SSH server. The connection steps use existing TermAI screenshots; the recovery checklist below is based on the linked official documentation, not a new device benchmark.
What you need before you start
- An iPhone with an SSH client installed. Any iPhone that runs a current iOS will do; these are ordinary App Store apps.
- The server's host — an IP address (
192.168.1.50) or a hostname (myserver.example.com,raspberrypi.local). - A username on that server —
root,ubuntu,ec2-user,admin, or whatever you created. - Either the account password or an SSH key whose public half is on the server.
- A network path to the machine. Same Wi-Fi is easiest. A public IP works. For a box behind a home router while you're out, you'll want a mesh VPN — covered below.
- SSH actually running on the target. On most Linux servers it already is; on a Mac, Windows PC, or a fresh Pi you have to switch it on first.
You do not need a jailbreak, a Mac, a paid Apple Developer account, or a subscription — several clients connect for free indefinitely.
Step 1 — Install an SSH client for iPhone
Because iOS has no Terminal app of its own, the client is the terminal. Any of these will complete this guide; we compared them in depth here.
TermAI has a free tier and paid plans with monthly AI allowances. Check current TermAI plans and your App Store purchase screen for the price in your region. Feature availability and limits can change. Other clients have their own plans and supported authentication methods; check their official listings before choosing one.
The screenshots below use TermAI. You still need an authorized server account, working SSH service, and a network route to the machine. Installing a client alone does not grant server access.
Step 2 — Add a connection
Tap to create a new connection and fill in three things:
- Host — the server's IP address or hostname (e.g.
192.168.1.50ormyserver.example.com) - Port —
22unless your server uses a custom one - Username — your login on that server (e.g.
root,ubuntu,pi)
Two things people get wrong here. The username is the server's user, not your Apple Account — nothing about your iPhone identity is involved. And if you're on a home network, find the right IP first: check your router's client list, or run ip a (Linux) / ipconfig (Windows) / ifconfig (macOS) on the target machine. A hostname ending in .local only resolves on the same LAN.
Step 3 — Choose how you authenticate
Two options:
- Password — simplest to start: type your server password when prompted.
- SSH key — more secure and the right long-term choice. Generate or import a key in the app, then add its public key to the server's
~/.ssh/authorized_keys. The server may still require a key passphrase or another authentication factor, depending on its policy.
For a server you'll use often — especially anything exposed to the internet — use a key and consider disabling password login on the server.
Generating a key on the phone vs. importing one you already have
Both work, and the choice matters more than people think:
- Generate on the iPhone (recommended). Check how your chosen client stores, exports and optionally syncs generated keys. A key stored in Keychain is not automatically a non-exportable Secure Enclave key. You then copy the public half to the server. One key per device means you can revoke the phone alone if you lose it, without touching your laptop's access. Step by step: create an SSH key on iPhone.
- Import an existing key. Paste the private key or open it from the Files app. Passphrase-protected keys and AWS
.pemfiles both work. Getting a key file onto the phone safely is the awkward part — AirDrop from your Mac or an encrypted note beats emailing it to yourself.
Two gotchas: PuTTY .ppk keys are not OpenSSH format and must be converted on a desktop first, and if you're choosing a new key type, Ed25519 beats RSA on both speed and size — which is noticeable on a phone. If you want the reasoning for keys over passwords at all, see SSH keys vs passwords.
Step 4 — Connect
Tap the connection. On the first connection, compare the displayed host-key fingerprint with a trusted record from your server administrator or hosting console. Accept it only when they match. A first-use prompt by itself does not prove the server is genuine. On a Linux server with OpenSSH and an Ed25519 host key, an administrator can inspect the public key fingerprint from a trusted console with ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub. Match the same key algorithm in the client. If the key changes unexpectedly later, stop and investigate before replacing the saved key.
What you're looking at is a real shell, not a restricted one: htop, vim, tmux, docker ps, journalctl -f all behave the way they do on a laptop, because SSH doesn't care what kind of machine you typed from. If that fingerprint prompt ever comes back unexpectedly on a server you've connected to before, stop — that's the warning the mechanism exists for. Background: host key verification explained.
Step 5 — Make the keyboard usable
This is the step guides skip, and it's the one that decides whether SSH on an iPhone is pleasant or miserable. The iOS keyboard has no Esc, no Tab, no Ctrl, and no arrow keys — which means no Ctrl+C, no tab-completion, no command history, and no way out of vim.
Every serious iPhone SSH client solves this with a special-key row above the keyboard. Learn these five and the phone becomes a real terminal:
- Ctrl+C — kill the running command. The single most-used key on a phone.
- Tab — completion, so you're not typing long paths on a touchscreen.
- ↑ — recall the last command instead of retyping it.
- Esc — get out of
vim's insert mode, cancel prompts. - Ctrl+D or typing
exit— end the session cleanly (more ways to exit).
Two more phone-specific habits worth building: save the commands you run constantly as snippets so they're one tap, and paste rather than type anything long. A full list of what's worth memorising is in SSH keyboard shortcuts on a phone. If you pair an external keyboard — on an iPhone or, more usefully, an iPad — check the client maps Esc and Ctrl properly; see SSH from an iPad.
SSH into a Raspberry Pi from your iPhone
Same four steps, with Pi-specific details that have changed since most tutorials were written:
- Enable SSH first. Easiest: turn it on in Raspberry Pi Imager's advanced options before you write the card. On a running Pi:
sudo raspi-config→ Interface Options → SSH. On a card you've already written, place an empty file namedsshon the boot partition (on Bookworm and later that partition mounts at/boot/firmware). - There is no default
piuser any more. Raspberry Pi removed the built-inpi/raspberryaccount in 2022 for security reasons — you now create the username yourself in Imager or in the first-boot wizard. Use that name in step 2. Older guides telling you to log in aspiwith passwordraspberryare out of date, and the empty-ssh-file trick alone won't help if no user account exists yet (that's what Imager's settings, or auserconf.txt, are for). - Finding it. Try the hostname you set in Imager plus
.local(e.g.raspberrypi.local) on the same Wi-Fi, or look up the Pi's IP in your router's DHCP client list.
That's headless Pi administration from your phone: no monitor, no keyboard, no HDMI adapter. Full walkthrough with screenshots: SSH from iPhone to a Raspberry Pi. Common Pi jobs from the phone — Pi-hole and Home Assistant — have their own guides.
SSH from iPhone to a Mac, PC, Linux, or Windows
The steps are identical; only the host details change:
- To a Mac — enable Remote Login (System Settings → General → Sharing), then connect with the Mac's IP or
.localname and your macOS short username. Note that macOS's own username is often not what you'd guess — check it withwhoami. Full guide: SSH from iPhone to Mac. - To a Windows PC — install the built-in OpenSSH Server (Settings → System → Optional features → Add → OpenSSH Server), start the
sshdservice, then connect with your Windows account name. You'll land in a PowerShell or CMD prompt rather than bash; to get a Linux shell instead, SSH into WSL. - To a Linux server or PC — use the machine's IP and a user like
ubuntuorroot. This is the most common case and works out of the box on most distros, sinceopenssh-serveris installed by default on server images. On a desktop distro you may needsudo apt install openssh-serverfirst. - To a VPS or cloud instance — the same, using the provider's default user:
rooton most VPS images,ubuntuon Ubuntu AMIs,ec2-useron Amazon Linux. Import the provider's.pemkey in step 3. See SSH to EC2 from your phone and managing a VPS from a phone. - To another phone or a container — Android with Termux running
sshdworks fine; Docker containers usually don't run SSH at all and are better reached withdocker execafter you SSH to the host (details).
Connecting to a server outside your home network
SSH works instantly on your local Wi-Fi. The moment you leave the house — on cellular, or on café Wi-Fi — a private address like 192.168.1.50 stops meaning anything, and this is where most "it worked yesterday" reports come from. You have three options, in order of how much we'd recommend them:
- A mesh VPN (recommended). Tailscale or WireGuard give the server a stable private address that works from anywhere, with nothing exposed to the internet. TermAI has Tailscale built in, so tailnet machines show up in the host list without a second app juggling VPN profiles — see Tailscale on iPhone and Tailscale vs WireGuard.
- Port forwarding. Works, but it publishes SSH to the whole internet and it will start logging bot attempts within hours. If you do it: key-only auth, no root login, and fail2ban. Also note that many home ISPs and essentially all mobile carriers put you behind CGNAT, in which case there is no inbound path to forward at all — no router setting can fix that.
- A reverse tunnel from the server out to a machine that does have a public IP. Fiddly, but it works from behind any NAT (SSH tunnelling explained).
One more case that catches people out: some hotel, café, and corporate networks allow only ports 80 and 443, so port 22 simply never gets through. If you administer the server, having sshd also listen on 443 is the standard workaround (changing the SSH port); if you don't, tethering to cellular usually gets you out. Broader options: accessing a home server from anywhere.
Keeping work running when iPhone SSH disconnects
iOS can suspend an app in the background, and network changes can interrupt an SSH connection. There is no fixed background lifetime that this guide can promise. A keepalive or reconnect button does not guarantee an uninterrupted session. Separate the phone connection from the work running on the server.
A tmux recovery checklist
Use this on a server you administer, with tmux already installed. These are example commands; the session name phone-work is arbitrary. They do not change the phone's background permissions.
- Connect from the iPhone, then run
tmux new-session -s phone-workon the remote server. - Inside that session, run a harmless read-only command such as
date. Start your real task there only after checking its impact and permissions. - Detach deliberately with the tmux prefix Ctrl+B, release the keys, then press D. This leaves the tmux session on the server.
- Reconnect to the same server as the same user. Run
tmux list-sessions, thentmux attach-session -t phone-work. - If you see “no server running” or the named session is absent, check the host and username. The session may also have ended, or the server may have restarted.
tmux preserves a server-side session while its server process is running. It does not survive every reboot, out-of-memory kill, administrator action or program failure, and it does not keep the iPhone's TCP connection alive. Save important work and use appropriate server-side job management for critical tasks. See the official tmux getting-started guide and our guide to jobs after SSH disconnects.
Check three connection conditions separately
| Condition | What to record | Recovery check |
|---|---|---|
| App in foreground on Wi-Fi | Device/app version, server address, connection time and any error | Confirm ordinary SSH works before testing background behavior |
| Lock the phone or switch apps | Whether the connection remains usable when you return; do not assume a universal timeout | Reconnect and look for the named tmux session |
| Move between Wi-Fi and cellular | Whether the server is reachable from the new network and whether SSH disconnects | Restore the network route, reconnect, then attach to tmux |
This is a reproducible checklist, not a claim that TermAI passed a particular duration test. Never publish private server addresses, authentication tokens or unredacted terminal output when sharing results. If a specific error appears, use the broken pipe or connection closed guide.
Can you SSH into an iPhone?
No — not on a stock iPhone. This is the other half of what people mean by "iPhone SSH", so it's worth answering plainly. iOS runs no SSH server, and the App Store doesn't permit an app to provide one, so there is nothing on the phone for a computer to connect to. That capability only ever existed on jailbroken devices (the old root/alpine default that security guides warn about).
Everything on this page is the opposite direction: your iPhone is the client, connecting out to a server. If your actual goal is reaching files on the phone from a computer, use the Files app, AirDrop, iCloud Drive, or an SFTP/WebDAV client app instead — and if the goal is moving files between phone and server, that's SFTP, which most of these clients include (best SFTP app for iOS, transferring files over SSH).
The ssh command on iPhone, iSH, a-Shell, and "PuTTY for iPhone"
Three related things that come up in the same searches:
- A dedicated SSH client provides a connection form. You do not need a local shell on the iPhone to connect to a remote shell. Some other apps provide local Unix environments; that is a different capability.
- iSH and a-Shell give you a shell that runs on the phone itself — iSH emulates x86 to run Alpine Linux, a-Shell provides native Unix tools plus Python. Both are free, and you can run
sshinside them, but there's no saved-host list, no key manager, no tap-to-connect, and iSH's emulation is slow. They're for running tools locally, not for administering servers. - "PuTTY for iPhone" doesn't exist. PuTTY is a Windows program with no iOS version; anything on the App Store using the name is unrelated. Use a real iOS client — and convert any
.ppkkeys to OpenSSH format on a desktop before importing (more on PuTTY on mobile).
Troubleshooting: the errors you'll actually hit
| What you see | What it means | Fix |
|---|---|---|
| Connection refused | You reached the machine, but nothing is listening on that port | Start/enable SSH on the target (sudo systemctl status ssh), or correct the port. Full guide |
| Connection timed out | You never reached the machine at all | Wrong IP, wrong network, or a firewall. From outside your LAN, use Tailscale. Full guide |
| Permission denied (publickey,password) | You reached SSH but it rejected you | Check the username first — it's the usual culprit — then the password, or that your public key is in ~/.ssh/authorized_keys. Full guide |
| Still asking for a password after adding a key | The server isn't accepting the key | Almost always permissions: ~/.ssh must be 700 and authorized_keys 600. Full guide |
| Host key verification failed | The server's identity doesn't match what was pinned | Expected if you rebuilt the server — then clear the stored key. If you didn't, stop and investigate. Full guide |
| No matching host key type | A very old server and a modern client disagree on algorithms | Update the server's sshd, or enable the legacy algorithm deliberately. Full guide |
| Works at home, not away | You're asking for a private IP from outside the LAN | Use a mesh VPN — see remote access |
| Session dies when you switch apps | iOS suspended the app | Normal. Use tmux/mosh/auto-reconnect — see keeping sessions alive |
For errors inside a session — a command that fails once you're connected — TermAI lets you long-press to select the output and tap 🤖 Ask AI, which sends that exact error to the assistant along with the session's real context (OS, what's installed, recent output) for an explanation. It beats retyping a cryptic message into a search box on a phone. A wider index of failures is in the SSH troubleshooting guide.
Is SSH from an iPhone safe?
The protocol is identical to the one you use from a laptop, so the encryption isn't the weak point — the device is. Security also depends on the app, device lock, key storage and server policy. Keychain storage and Secure Enclave-backed non-exportable keys are different; do not assume every generated SSH key uses the latter. Five things worth doing:
- Use a key, not a password, and give the phone its own key so you can revoke it alone if the device is lost.
- Turn on the client's Face ID / passcode lock, separate from the phone's own unlock.
- Verify the host fingerprint on first connect, and take a repeat prompt seriously.
- On the server, disable root login and password auth once your key works.
- Don't port-forward 22 if you can use a mesh VPN instead.
One iOS-specific note: key export, sync and hardware-backed storage depend on the app and key type — see Secure Enclave SSH keys for the trade-offs of that.
FAQ
How do I SSH from my iPhone?
Install an SSH client from the App Store, create a connection with the server's host (IP or hostname), port 22, and your username, choose a password or an SSH key, then tap connect and compare the host-key fingerprint with a trusted server record before accepting it. The whole thing takes about five minutes and needs no jailbreak.
Is there a built-in terminal on iPhone?
Use an SSH client app to open a remote terminal from an iPhone. You do not need to jailbreak the phone or run a local shell first.
Does iPhone support SSH?
Yes, as a client. iOS has no SSH built in, but App Store clients implement the full protocol — keys, SFTP, port forwarding, jump hosts — so an iPhone connects to a server exactly like a laptop does.
Do I need to jailbreak to SSH from iPhone?
No. A normal App Store SSH client works on any stock iPhone. Jailbreaking is only relevant to the reverse direction — running an SSH server on the phone.
Can I SSH into my iPhone from a computer?
No. Stock iOS runs no SSH server and the App Store doesn't allow one, so there's nothing to connect to. Use the Files app, AirDrop, or an SFTP app to reach files on the phone instead.
What's the best app to SSH from an iPhone?
Choose by the authentication, keyboard, file-transfer and network features you need. TermAI offers SSH, SFTP, AI command help and built-in Tailscale, subject to build availability and plan limits. Full comparison: best SSH client for iPhone.
Can I SSH from an iPhone for free?
TermAI has a free tier. Check the current in-app connection limits, supported features and subscription terms before choosing a plan. Other clients have separate terms.
How do I SSH from my iPhone to a Linux server?
That's the standard case and needs nothing special on the server: most Linux distributions run openssh-server already. Use the server's IP, port 22, and a user such as ubuntu or root. On a desktop distro that refuses the connection, install it with sudo apt install openssh-server.
How do I SSH from my iPhone to a Raspberry Pi?
Enable SSH in Raspberry Pi Imager or with sudo raspi-config, then connect to the Pi's IP or .local hostname with the username you created during setup. There's been no default pi/raspberry account since 2022.
Can I SSH from my iPhone over cellular data?
Yes — SSH is just TCP and works fine on 4G/5G. What breaks is addressing: a private IP like 192.168.x.x is unreachable off the LAN, and carriers put you behind CGNAT. Use Tailscale or another mesh VPN and the server keeps the same address everywhere.
Why does my iPhone SSH session disconnect when I leave the app?
iOS may suspend the app, or the network may change. Run long jobs in tmux on the server, then reconnect and reattach. Reconnection alone does not restore a terminated shell.
Can I use my existing SSH key on an iPhone?
Yes — paste it or import it from the Files app, including passphrase-protected keys and AWS .pem files. Generating a fresh key on the phone and adding its public half to authorized_keys is the better habit, since you can revoke that one device. PuTTY .ppk files must be converted to OpenSSH format first.
Is SSH from a phone secure?
Yes — it's the same encrypted SSH protocol as on a desktop. Use key authentication, keep the key in the Keychain behind Face ID, verify the host-key fingerprint through a trusted source before accepting the first connection, and lock the app itself.
Is SSH on an iPad the same as on an iPhone?
Identical apps and identical steps — iPadOS has no terminal either. The difference is ergonomic: an external keyboard makes the special-key row less critical. See SSH from an iPad.
How do I exit an SSH session on iPhone?
Type exit and press Enter, or use the Ctrl key in the special-key row followed by D. Closing the app also ends the session — which is why long jobs belong in tmux.
Quick Facts
- Task: SSH from an iPhone to a Linux server, VPS, Mac, Windows PC, or Raspberry Pi
- Needed: an App Store SSH client — no jailbreak, no computer, no developer account
- Built-in terminal on iOS: use an SSH client app for remote access
- Connection: host (IP/hostname) + port 22 + username
- Auth: password to start; SSH key for anything serious
- Keyboard: use the client's Esc/Tab/Ctrl/arrow row — Ctrl+C and Tab are the ones you'll miss
- Raspberry Pi: enable SSH first; no default
piuser since 2022 - Remote access: use Tailscale instead of forwarding port 22
- Long jobs: run them in
tmux— iOS suspends backgrounded apps - SSH into an iPhone: not possible on stock iOS — no SSH server exists
- Time: about 5 minutes for a first connection
Sources and scope
This guide is maintained by the TermAI team. Product screenshots illustrate our app; they are not an independent review. The November 5, 2026 update adds a server-side tmux recovery checklist and clarifies first-use host verification. No new timed iPhone background or cellular benchmark is claimed.
- OpenSSH ssh manual: host authentication and SSH connection behavior.
- tmux official getting-started guide: sessions, detach and reattach.
- Tailscale SSH documentation: the separate Tailscale SSH server feature and its access policies. Ordinary OpenSSH over a tailnet still needs its own server authentication.
Start with Free on iOS or Android. Current connection limits, AI allowances and subscription terms are shown in the app before purchase.