2

I disconnect frequently by lag/timeouts or similar from a machine I am connected in to via SSH and I was wondering if my sessions are still active somewhere or if they close/logout after a certain time?

If they are not disconnected, is there a way to connect back in to the session?

(FYI, this is a default install/nothing funky... SSH is in default configuration).

  • If you connect with ssh and start screen on the remote machine, then even in case of disconnection you can get back to the same sessione later. – enzotib Jan 5 '12 at 14:48
3

They timeout.

If you want to change that behaviour you can use things like screen. Screen is essentially a terminal session that stays running. You can get disconnected and then just reconnect and attach to the screen session again. It's a bit daunting at first but it's pretty handy.

I've personally found that adding -o ServerAliveInterval=30 to my SSH commands helps keep a connection alive but it won't help in cases of network interruption.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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