I have a question to which I haven't been able to find an answer. I have two computers, both of which run Ubuntu 12.04. I keep one of my computers at home and use SSH to connect to it from the other ("remote") computer. The remote computer is able to connect to the home computer without problems. The remote computer also has SetAliveInterval set to 60 in /etc/ssh/ssh_config, so that the connection doesn't die if I step away from the computer for a moment.
Occasionally, my internet connection on my remote computer gets interrupted. Internet interruptions cause my SSH tunnel to close (of course). When I restore internet connectivity and re-connect to the home computer using a new SSH tunnel, though, I can see using
#ps ax that the old SSH connection process is still running. This is a problem because I use an encrypted home directory on the home computer, which doesn't allow the files to be re-encrypted until that (now-dead) SSH connection is killed.
Is there a way to set sshd_config on the home computer so that it automatically detects when a connection has died, and terminates it?