How to stop being logged out of SSH sessions when locking the screen in OS X 10.9.1?
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.