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?
Asked
Active
Viewed 337 times
1

Tissot11
- 53
- 2
-
if your mac goes to sleep, your connections will drop, including the connection holding open the master connection and therefore the corresponding ControlPersist socket. This is expected behavior. Once the connection is gone, there's nothing left to control until you set up another connection. – programmerq May 24 '21 at 15:08
1 Answers
0
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.

VonC
- 1,262,500
- 529
- 4,410
- 5,250