Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
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
up vote 3 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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