Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Within a minute of connecting to my remote Linux server through SSH, my session times out and I cannot contact the server until a few seconds have passed. Meanwhile, I'm connected to other servers without interruption. This is only happening when I establish connection from an hotel wireless AP. When I connect from my phone's Internet, the problem does not occur. Does anyone know what might be causing these unusual timeouts?

share|improve this question

migrated from stackoverflow.com May 16 '10 at 0:51

This question came from our site for professional and enthusiast programmers.

    
What error message do you get? Are you actively using the connection when it times-out? –  Steve Emmerson May 15 '10 at 23:30
    
This answer has some useful info: serverfault.com/questions/2201/ssh-session-idle-timeout –  gareth_bowles May 16 '10 at 2:00
    
Sounds like the hotel's network has a really poor NAT implementation. –  Zoredache May 16 '10 at 7:07

2 Answers 2

On your server, add the following line to /etc/ssh/sshd_config and restart the SSH daemon:

ClientAliveInterval 30

This will cause the server to send a message to the client requesting a response, if there has been no activity for 30 seconds. (Basically a ping to see if the client is still there).

If the hotel's firewall is kicking off "inactive" connections, this should keep your connection open as it will see activity at least once every 30 seconds.

share|improve this answer

If it only happens when you are at a hotel, then the problem is the hotel.

It sounds to me like the hotel's NAT is configured to aggressively time-out idle-looking sessions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.