Skip to content

Latest commit

 

History

History
91 lines (60 loc) · 1.58 KB

File metadata and controls

91 lines (60 loc) · 1.58 KB

Remote CLI (mosh + tmux)

This guide shows a resilient SSH workflow for mobile connections using mosh + tmux. It keeps sessions alive when your network drops or your phone sleeps.

Phone quick start

Replace mihai and the example host below with your own username and machine.

Headscale IP examples

ssh mihai@100.64.0.42
mosh mihai@100.64.0.42
mosh --ssh="ssh -p 2222" mihai@100.64.0.42

MagicDNS examples

ssh mihai@beeperclaw.tailnet.example
mosh mihai@beeperclaw.tailnet.example
mosh --ssh="ssh -p 2222" mihai@beeperclaw.tailnet.example

iPhone and iPad

  • Moshi: best fit if you want native mosh on iOS.
  • Termius: good SSH client for quick access; pair it with tmux if you do not need mosh.

Android

  • Termux: install the tools locally, then run the same commands as above.
pkg update
pkg install -y mosh openssh tmux

Install

macOS:

brew install mosh tmux

Ubuntu/Debian:

sudo apt-get update && sudo apt-get install -y mosh tmux

Connect with mosh

Replace your-host with a Headscale IP or MagicDNS name.

mosh your-user@your-host

If your SSH server uses a non-default port:

mosh --ssh="ssh -p 2222" your-user@your-host

Keep sessions with tmux

Start a named session:

tmux new -s beeperclaw

Detach:

tmux detach

Reattach later:

tmux attach -t beeperclaw

Why this helps

  • mosh survives network changes (Wi-Fi to cellular).
  • tmux keeps your session alive across disconnects.
  • Together, you can resume long-running tasks safely.