Showing posts from April, 2014

SSH linux how to kill an idle or innactive connection

Sometimes when you're disconnected abruptly from a remote server like if your network connection gets dropped, you can be left with a ghost or inactive SSH session. This can become pretty annoying when you're doing some SSH port redirection since you will not be able to bind to a given port since the ghost connection is still using that port, and you might end up with error messages such as the following : debug1: Local connections to LOCALHOST:21521 forwarded to remote address localhost:21521 debug1: Local forwarding listening on port 21521. bind: Address already in use debug1: Local forwarding listen Now there are a few ways of dealing with this issue, the one I prefer is a 3 step operation :1.Check who is connected to the server This step is actually optional but it allows you to check which user is currently connected to the server and prevent accidentally destroying another user's session (or at least warning him that you will do it ;) ) To check who's…