I'm using tmux + PuTTY to get all the UNIX goodness I need when using Windows. I have the following settings in my .tmux.conf:

set-option -g lock-command vlock
set-option -g lock-after-time 1800

As expected, after 30 minutes, my screen goes to this:

This TTY is now locked.  
Please press [ENTER] to unlock.

And then it all goes wrong... after awhile PuTTY gives me the follow error: Server unexpectedly closed network connection

enter image description here

Any thoughts on why I'm getting disconnected from SSH?

  • 2
    How long is "awhile"? Does it happen if you don't use vlock? I'm just guessing that the connection is timing out somehow. Maybe try some of the suggestions here: staff.ask.sydney.edu.au/app/answers/detail/a_id/614/~/…
    – depquid
    Apr 2, 2013 at 20:41
  • Good call there @depquid, that seemed to do the trick. Would you like to write up an answer since you pointed me in the right direction?
    – Jeff B
    Apr 5, 2013 at 12:58
  • It'd be better if you wrote up exactly what fixed the problem for you; all I did was 2 minutes of Google and pasted a link. :-)
    – depquid
    Apr 5, 2013 at 16:43

1 Answer 1


As suggested in the link provided by @depquid, changing connection timeout settings in PuTTY did the trick.

PuTTY settings screenshot

  1. Go to the Connection section of PuTTY's configuration screen
  2. Check Enable TCP keepalives (SO_KEEPALIVE option)
  3. In the Sending of null packets to keep session active, change the value for Seconds between keepalives to something other than zero. I had originally tried 1800 (30 minutes), but that ended up being too high. I'm doing 60 seconds now which might be overkill, but it's done the trick for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .