SSH, tmux, mosh or PandaSend: reaching your Mac's terminal from a phone

There's no single right way to reach your Mac's terminal from a phone. There are four common ones, and they solve different parts of the problem. Here's what each needs, what it's good at, and where it gets painful.

The three problems to solve

Every option has to answer the same questions:

  1. Getting there. How does your phone reach your Mac, especially from outside your home network?
  2. Staying there. What happens to the running program when your phone loses signal, sleeps, or switches from Wi-Fi to cellular?
  3. Typing there. How do you press Esc, Tab, Ctrl-C and the arrow keys on a phone keyboard?

Option 1: SSH

Turn on Remote Login in System Settings → General → Sharing, install an SSH app on your phone (Blink Shell, Termius and Prompt are popular on iPhone), and connect with a key. The full setup, including reaching the Mac from outside your home, is in how to SSH into your Mac from your iPhone.

Option 2: SSH plus tmux

tmux keeps a session running on the Mac independent of your connection:

tmux new -s work        # start a named session, then run your agent inside it
# press Ctrl-b, then d, to detach
tmux attach -t work     # later, from any connection: pick up where you were

Option 3: mosh (plus tmux)

Mosh replaces the SSH connection with one designed for mobile networks: it survives roaming between networks and sleep, and it shows your typing instantly instead of waiting for the round trip.

Option 4: PandaSend

PandaSend is narrower than all of the above: it only gives you terminal sessions on your own Mac, but it handles all three problems itself.

Which one should you use?

If you…Use
manage Linux servers or cloud machinesSSH + tmux, or mosh + tmux
already have SSH working and like itKeep it; add tmux if you don't have it
need file transfer or port forwardingSSH
want your Mac's agents and builds on your phone with nothing to set upPandaSend
spend a lot of time on patchy mobile networksmosh, or PandaSend

They also mix fine: plenty of people will keep SSH for servers and use PandaSend for the Mac on their desk.