WebFaction
Community site: login faq

Whenever I logon to my Webfaction account via ssh and leave the terminal unattended for a couple of minutes and do some other work, it is frozen when I come back. I can still see the cursor blinking but I cannot enter any commands or do anything. The only workaround is killing the terminal, opening a new one and ssh in again.

This wouldn't be too bad, but it even happens when I run my deployment scripts. Its just a .sh script doing a git clone, some rsyncs, a python manage.py runserver and a apache restart. All of these steps generate quite some output which I obviously want to see, in case something goes wrong. However the session still can freeze at any given point, stopping to show any more output. The script DOES run to its end successfully but I just cannot see the whole output. Opening a new terminal and all is fine, but of course the output will be gone then.

I talked about this on #linux several times and all those smart people there couldn't really help me. I was hoping for something insanely simple like "Awww noob! Just add this timeout variable to your .bashrc" or whatever but no one said anything like this :)

My last hope is, that you guys at Webfaction have set some sort of ssh session timeout - at least I would know the root of the problem by then but obviously I wouldn't have much chances to work around your settings, I guess... or would I? :)

asked 04 Mar '11, 03:50

mbrochh's gravatar image

mbrochh
86510
accept rate: 16%


This problem is most likely related to a router that does NAT on your network, which drops the NAT mapping after some idle time. To overcome this, you can turn on Keepalives in your SSH client. If you are using OpenSSH, check the corresponding entry in the OpenSSH FAQ.

permanent link

answered 04 Mar '11, 04:06

tie's gravatar image

tie
1.4k13
accept rate: 44%

I solved this problem by using screen after connecting to a Webfaction server via SSH.

I add a .screenrc file to the server with the following setting:

caption always '%c:%s'

This displays a status bar with a clock, which seems to be enough traffic (at least once a minute) to keep the connection alive.

permanent link

answered 12 Jun '12, 21:09

mbrochh's gravatar image

mbrochh
86510
accept rate: 16%

For others experiencing the disconnected-on-idle problem, here is how to get UNIX ssh and Windows putty to keep your interactive ssh alive:

https://patrickmn.com/aside/how-to-keep-alive-ssh-sessions/

(more detail on ServerAliveInterval option mentioned by ryans in the community question https://community.webfaction.com/questions/12091/sshftp-repeated-timeout?page=1&focusedAnswerId=21354#21354 )

http://www.nth-design.com/2010/05/10/using-keepalive-in-putty/

(in putty Configuration window, go to Connection and set "Seconds between keepalives" to something other than 0, such as 60 seconds)

permanent link

answered 14 Nov, 07:39

cpirazzi's gravatar image

cpirazzi
588
accept rate: 20%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×101
×4
×3

question asked: 04 Mar '11, 03:50

question was seen: 7,173 times

last updated: 14 Nov, 07:39

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2017 PARAGON INTERNET GROUP LIMITED
WEBFACTION IS A SERVICE OF PARAGON INTERNET GROUP LIMITED
REGISTERED IN ENGLAND AND WALES 7573953 - VAT REGISTRATION NUMBER 182147021
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM