Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
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 '13 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 Bridgman Apr 5 '13 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 '13 at 16:43
add comment

1 Answer 1

up vote 1 down vote accepted

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.
share|improve this answer
add comment

Your Answer

 
discard

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.