SSH Control master setup

524 views Asked by At

I'm using ssh Control Master setup to connect to remote machines and using ControlPersist 16h and ControlPath ~/.ssh/master-%C options. It seems to work fine. But when my Mac goes to sleep, it deletes the sockets created above. Then I'm forced to enter password again on login to this remote machine. Any suggestion, how one can get around this problem?

1

There are 1 answers

0
VonC On

Considerind a ControlPersist directive would not persist your computer sleeping, you would need another alternative in order to get what you want.

Namely, Mosh (mobile shell) (also on GitHub):

Mosh is a replacement for interactive SSH terminals. It's more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.

It does persists connections when your computer sleeps.

With Mosh, you can put your laptop to sleep and wake it up later, keeping your connection intact. If your Internet connection drops, Mosh will warn you — but the connection resumes when network service comes back.