How to stop being logged out of SSH sessions when locking the screen in OS X 10.9.1? Every time I lock my screen I get logged out of any active SSH sessions.

I've added the following to my ~/.ssh/config file, but I still get logged out:

Host *
  ServerAliveInterval 60


How can I stop being logged out of SSH sessions when I lock my screen?
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.