Using mosh to avoid losing ssh connections

From mn/bio/cees-bioinf
Revision as of 13:47, 17 September 2015 by (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Sometimes, when you are logging in to a cod node or abel, and move your laptop to another room, or switch wifi network, or it went to sleep, you I lose the ssh connection. To prevent that from happening, you can try using - at least for mac and linux users the mosh program:

USIT has installed mosh on abel and the cod nodes. You need to install it on your PC/MAC and then run mosh instead of ssh:


(or other nodes). Try unplugging your PC from the network, wait a minute and connect back. The connection stays!


1) on your Mac (NOT on abel or the cod nodes), you may had to add this line to my .bash_profile file:

export LANG=en_US.UTF-8

Some people report having to add this as well:

export LC_CTYPE=en_US.UTF-8

2) Use of iTerm2 instead of the native Teminal app is recommended. This is because scrolling up in the terminal window in the native Terminal is lost after a loss of network connection, while it is still possible in Iterm2.

3) for Windows PCs, there is no version of mosh, but you can (apparently) use MobaXterm, or the chrome plugin (check If you get this to work, let us know!