I've been having this issue, that when I exit a ssh session, it never quits properly. I have to kill it with Ctrl-C. Example Session Below:[stefan@desktop ~]$ ssh stefan@10.0.0.4[stefan@laptop ~]$ # do some stuff[stefan@laptop ~]$ exitlogout^CKilled by signal 2.[stefan@desktop ~]$Is there a reason this happens? ( some running proccess that blocks a clean exit perhaps ). And how can I fix it?
ssh session never exits cleanly
ssh
From the ssh man page:The session terminates when the command or shell on the remote machine exits and all X11 and TCP connections have been closed.You've killed your shell, but it looks like some application still has a connection open over a forwarded port (the agent, X11, or a forwarding set up with -D, -L, -R or their ~/.ssh/config equivalent).If you don't know what program is using the forwarding, use lsof -p $pid where $pid is the process id of the ssh client (on the client) or the sshd process that was the parent of the shell (on the server) to find out what ports it has open connections on. Then use lsof -i -n or netstat -pnt and search for processes that have connections open on these ports.