If I don't exit out of SSH, what happens? Do the sessions build up over time? Is it a security risk?


If you have a firewall in front of your host which "expires" old sessions, you won't be logged in very log after leaving it idle (unless of course you use ServerAliveInterval setting of SSH).

SSH does consume additional resources for every connection you make, albeit very little. The security risk is introduced if your system which you left the connection open on is compromised (either remotely or locally at the keyboard). You'll already be authenticated and logged in, which defies any security measures SSH provides in the first place. If you don't really need to keep your sessions open, it's best to close them.


This depends a lot on the configuration of the SSH server - many servers are configured by the admin to time out a session after a given period of time, and most will drop sessions that have been terminated from the client-side even if you don't exit.

The users command on most (all?) linux distros will tell you if you're logged in more than once.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.