SSH - Encountering timeouts
From time to time, your usually stable ssh connection to Atlas may terminate. There are many possible reasons for this but understanding the reasons and mitigating the problems is straight-forward:
mandatory IP change on (home) DSL connections
Usually, Internet Service Providers try to prevent customers to run servers on their private DSL lines and therefore force your modem to reconnect every 24h.
Thus, if you left a ssh
connection running overnight, chances are
that your (home) DSL line could be reconnected and your modem got a
different IP. This means, your previous connection is now broken.
There is not much one can do against this happening and you should
simply reconnect (and read the hints on tmux
or screen
below).
timeouts because of intermittent networking problems
Sometimes either your (home) DSL line, your WiFi connection, the network at Atlas or any network in-between has troubles and the network packets are discarded or simply cannot find their correct destination.
This can happen at any time but is usually not really noticeably, except maybe a higher latency while typing remotely or even your terminal being completely stuck for a few seconds. Sometimes though, these are enough to terminate a connection.
To counter this, you can tell ssh
to be more lenient and that it
should wait longer for networking problems to sort themselves out by
adding this to your ~/.ssh/config` file:
Host *
ServerAliveCountMax 30
ServerAliveInterval 3600
(Please note, that you should only have a single Host *
instance in
your config file! Also, you may want to set it only for Atlas related
hosts, then you can simply replace the Host *
line by Host
*.atlas.aei.uni-hannover.de
.)
tmux
and screen
Both tools are well suited for continuing work even when you are logged out of a remote machine or your connection breaks.
The typical steps involved are simply:
- ssh into a remote host
- start either
tmux
orscreen
- work within these environment
- disconnect and log out of the system when your day’s work is done.
Later, you can simply re-attach to the same session and continue where you left of.
Instead of providing some initial steps here, we will simply link to one of the many tutorials on the web, e.g. a tmux and a screen tutorial.
Both are installed on every Atlas node and are extremely powerful tools!