How to stop being logged out of SSH sessions when locking the screen in OS X 10.9.1?
It really depends on what is logging you out. Assuming that this is not an issue of changing Power settings (i.e. your machine is not sleeping), then most things that will break the connection can be solved by using a program called autossh
.
It's a wrapper around the regular ssh
program (which it uses) and it implements a more robust keep-alive mechanism.
I got mine from MacPorts, but I'm sure Fink has a port, too.
Two methods…
-
Add the following to
/etc/ssh_config
:TCPKeepAlive yes
-
Use
screen
:- Create a new screen with
screen
, then use the terminal normally. - When the connection breaks, reconnect normally.
- Run
screen -dr
to reattach.
- Create a new screen with