Supervised SSH Into a Friend's Mac

I’ve been working with a friend to harden the personal infrastructure around the productivity stuff we’re both building, mostly handling more ideas and routing them to the right places, with LLMs and agents stepping in where it makes sense. My side is pretty robust and stable at this point. His is coming along, and I often want to be the one typing on his computer: go in, make a bunch of changes, and hand the machine back.

The problem is he’s a couple thousand miles away.

So I had some constraints. I wanted it supervised: he could open the door quickly, then tear it down so I no longer have access. Not a standing key to his machine, just a thing he turns on when he’s there and off when he’s done. And I wanted SSH, because it’s the fastest way to get hands on a terminal. We’re both on Tailscale, and the share feature is elegant for exactly this, without needing big changes to either of our network setups.

The supervised part is a shared tmux session. He boots up a session called pair, and that’s the signal he’s ready. A forced command in his authorized_keys means my key can only do one thing: attach to that session. If pair isn’t running, the attach fails with “session not found” and the connection drops, so there’s no way for me to let myself in. Only he can start it. While I’m in, tmux mirrors the terminal, so he watches every keystroke. He can detach me or kill the session at any point.

It covers the three things I wanted: no standing access, full visibility, and when it’s live it’s just a terminal. We’ve been running it like this and so far it’s working out really well.

The few things at play

  • Tailscale node-share for reachability across tailnets.
  • A shared tmux session so he sees every command live.
  • A forced-command SSH key so I only land in that tmux, and only when he’s started the session.

Setup (once)

Me:

  • Send him my SSH public key (~/.ssh/id_ed25519.pub).
  • Accept his Tailscale share invite.

Him:

  • Turn on Remote Login (System Settings → General → Sharing).

  • Add my key to ~/.ssh/authorized_keys with a forced command:

    command="tmux attach -t pair",no-port-forwarding,no-agent-forwarding ssh-ed25519 AAAA...mykey carlos
    
  • In the Tailscale admin console, share his Mac to my email (his Mac → Share).

  • Add a tailnet policy (ACL) rule allowing port 22 from my user to his machine. Sharing the node is separate from allowing SSH, and this step is easy to miss.

Each session

  1. Him: open Terminal, run tmux new -s pair, say ready.
  2. Me: ssh friend@<his-mac-tailscale-ip>, drops straight into his tmux.
  3. I type commands, he watches live.
  4. Him, to end it: Ctrl-b d to detach me, or tmux kill-session -t pair to cut access entirely.

Et voilà

  • No session, no access. The connection only works when he’s started pair.
  • tmux attach only attaches, never creates, so I can’t open the door myself. (Don’t use new-session -A, which would.)
  • The forced command means I only ever land in that tmux, never a raw shell.
  • He watches everything and can kill it instantly.

One caveat: inside tmux it’s a full shell as his user. The supervision is visibility, not a sandbox. He sees everything and can pull the plug, but while I’m in, I can do what his account can do. For two people who trust each other and want a fast way to pair across the country, that’s exactly the tradeoff I wanted.