How to SSH into your Mac from an iPhone
macOS ships an SSH server. Turning it on takes a minute; reaching it from outside your home and keeping work alive on a phone take a little more. Here is the whole route.
1. Turn on Remote Login
On the Mac, open System Settings → General → Sharing, click the Info button next to Remote Login and switch it on. In "Allow access for", pick "Only these users" and leave just your account. Apple's help notes that Remote Login enables both SSH and SFTP; there is also an option to allow full disk access for remote users — leave it off unless you need it.
On the same network you connect as ssh [email protected]; the Mac's local
hostname is shown at the bottom of the same Sharing pane.
2. Pick an SSH app and use a key
Any iPhone SSH client will do — Termius, Blink Shell and Moshi are the well-known ones, and
we compare them in a separate guide.
Generate a key in the app, append its public half to ~/.ssh/authorized_keys on the
Mac, and once the key works, consider turning off password logins in sshd_config.
3. Reach it from outside your Wi-Fi
your-mac.local only resolves at home. From cellular or another network you need a
route to the Mac. Do not forward port 22 on your router to the internet: an exposed SSH login is
scanned constantly. Put both devices on a VPN instead — a mesh VPN such as Tailscale, or WireGuard
on your router — and connect to the Mac's VPN address.
4. Keep sessions alive
iOS suspends apps in the background, and an SSH connection drops when you switch networks. Run
long work inside tmux (brew install tmux) and reattach with
tmux attach. Mosh, where your app supports it, survives network changes better than
plain SSH.
5. Keep the Mac awake
A sleeping Mac answers nothing. See keeping a Mac awake for remote access.
When SSH is all you need
If you type commands and read their output, this setup is free, standard and works with every server you own, not just the Mac. Keep it.
Where ShiftStage differs
ShiftStage is not an SSH client and does not use Remote Login. A small agent on the Mac gives the phone a real PTY — your shell, your dotfiles, several sessions that live on the Mac and keep running when the phone drops — and, around it, what a terminal shows badly on a six-inch screen:
- files with previews and the share sheet, limited to folders you name;
- git as structure: the diff marked inside the line, staging line by line, commit, push;
- processes with their ports, and dev servers you restart with a tap;
- AI coding agents — Claude Code, Codex and others — whose questions arrive as notifications with buttons.
There is no port to open and no VPN to run: on the same Wi-Fi the phone talks to the Mac directly, away from home peer to peer or through a relay that forwards only end-to-end encrypted bytes. Killing processes and sudo start switched off on the Mac, and every operation is written to a log you read on the Mac — never contents or output.
Set it up once
- Install the agent on the Mac. A signed, notarised app from our open
Homebrew tap. It shares only the folders you name.
brew install --cask shiftstage/shiftstage/shiftstage-agent - Install the app on the iPhone from the App Store.
- Pair them. Scan the code on the Mac's screen and check that both devices show the same seven symbols. No account. On the free plan the first pairing needs both on the same network.
Nothing stops you from keeping both: SSH for servers, ShiftStage for the Mac.
Get it
The Mac agent: download page — one Homebrew command or a notarised disk image. The iPhone app: App Store. Free forever for one Mac on your own network, no account; $7.99 a month or $69.99 a year to reach it from anywhere.
More guides: all guides.