Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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 installed mosh on a desktop and server yesterday (compiled latest v1.2.3 from source) and it works fine. I left the session open yesterday and have come into the office today to find my mosh session is dead, with the error along the top of the terminal window:

mosh: Last contact 14723 seconds ago. [To quit: Ctrl-^ .] 

I thought mosh should auto reconnect, or do I have to manually tell it to reconnect? If so, how? Or, is it a setting I need to enabled somewhere, to auto reconnect?

I left an SSH session open to the same server, this is still working just fine.

share|improve this question
mosh automatically reconnects but if you have screen or tmux running and detached/reattached the screen-session from somewhere else mosh can't reconnect – Ulrich Dangel Feb 21 '13 at 10:15
Well mine hasn't reconnected, but my seperate SSH window is still active (perhaps just a momentary drop in the night as this is over ADSL). In the SSH window I am just sitting at the terminal prompt, in the mosh window, I had a screen session open in which I was running irssi. Do you think its something to do with that? – jwbensley Feb 21 '13 at 10:20
up vote 3 down vote accepted

Mosh will reconnect by default, no additional configuration should be done for that.

As for your case, I suspect one of the following:

  1. mosh daemon has died on the server side for some reason. Check if it's still running.
  2. Somehow the UDP port mosh uses has been blocked. It might be a problem in the router between the client and the server, or a problem in the network configuration on either side.
share|improve this answer
Being the massive Baboon that I am (probably an insult to Baboons) I had missed some server maintenance that went on, and my iptables rules for mosh was removed. Network problems, cheers! – jwbensley Feb 21 '13 at 10:24

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.