Tutorial

How to SSH from your iPhone (to Linux, Mac, or a Pi)

A step-by-step guide to SSH from an iPhone: install a client, add a connection, password vs key, connect, and reach a Raspberry Pi or home server — no jailbreak required.

CC Chen Chen· Founder·June 9, 2026·6 min read

Can you SSH from an iPhone?

Yes. iOS doesn't ship a built-in terminal, but installing an SSH client app gives you a full SSH client in your pocket — enough to connect to a Linux server, your Mac, or a Raspberry Pi and run real commands. This guide walks through it step by step. The screenshots are from TermAI, but the flow is the same in any modern client.

Step 1 — Install an SSH client

Get an SSH client from the App Store. We compared the options here; this guide uses TermAI because it adds an AI command assistant and built-in Tailscale, with a free tier. Whatever you pick, the steps below are nearly identical.

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.50 or myserver.example.com)
  • Port22 unless your server uses a custom one
  • Username — your login on that server (e.g. root, ubuntu, pi)
Adding a new SSH connection on iPhone — host, port, and username fields
A new connection needs just host, port, and username. Add a password or import an SSH key for authentication.

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. After that you connect with no password.

For a server you'll use often — especially anything exposed to the internet — use a key and consider disabling password login on the server.

Step 4 — Connect

Tap the connection. On the very first connect you'll see a host-key fingerprint prompt — that's normal and a good thing (it's how SSH pins the server's identity so nobody can impersonate it later). Accept it once and you're in.

A live SSH session on iPhone showing a successful login to a Linux server
Connected. You now have a full shell — run any command as you would on a desktop.

SSH into a Raspberry Pi from your iPhone

Same steps, with Pi specifics: enable SSH on the Pi first (sudo raspi-config → Interface Options → SSH, or drop an empty file named ssh on the boot partition). Find the Pi's IP with your router or ping raspberrypi.local, then connect with host = that IP, username = pi (or your user). You're now running your Pi headless from your phone.

Connecting to a server outside your home network

SSH works instantly on your local Wi-Fi. To reach a machine at home while you're out, you don't want to forward port 22 to the internet. The easy, safe path is a mesh VPN like Tailscale — TermAI has it built in, so you connect to your home server's private address from anywhere with no port forwarding. See Tailscale vs WireGuard.

Troubleshooting

  • Connection refused — the SSH server isn't running or the port is wrong. On the target run sudo systemctl status ssh.
  • Connection timed out — wrong IP, or a firewall/different network is blocking it. Confirm you can reach the host.
  • Permission denied — wrong username, password, or your key isn't in authorized_keys yet.
  • Works at home, not away — you're trying to reach a private IP from outside. Use Tailscale (above).

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 for an explanation. It beats retyping a cryptic message into a search box on a phone.

FAQ

Is there a built-in terminal on iPhone?
No. iOS has no terminal out of the box; an SSH client app provides one.

Do I need to jailbreak to SSH from iPhone?
No. A normal App Store SSH client works on any stock iPhone.

Is SSH from a phone secure?
Yes — it's the same encrypted SSH protocol as on a desktop. Use key authentication and accept the host-key prompt on first connect.

Quick Facts

  • Task: SSH from an iPhone to a Linux server, Mac, or Raspberry Pi
  • Needed: an App Store SSH client (no jailbreak)
  • Connection: host (IP/hostname) + port 22 + username
  • Auth: password to start; SSH key for anything serious
  • Remote access: use Tailscale instead of forwarding port 22
Try TermAI

Free on iOS and Android. 5 AI requests/day on the free tier, plus unlimited SSH/SFTP and built-in Tailscale.

CC
Chen Chen — Founder of TermAI

Writes about mobile DevOps, terminal UX, and the surprising depth of "boring" infrastructure.

Was this useful? ← Back to blog