DEV Community

Discussion on: Persistent SSH Sessions with Tmux

Collapse
 
darkflib profile image
Mike Preston

Turn on keepalives in ssh config...

autossh -M 0 -t user@host tmux new -s sessname -A

This allows me to roam across networks and seemlessly reconnect if the connection fails.

It works on my 120mile commute across multiple networks flawlessly... and across laptop sleeps.