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