3

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?

2 Answers2

4

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.

Nate
  • 2,366
  • 4
  • 22
  • 25
0

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.

David Mackintosh
  • 14,293
  • 7
  • 49
  • 78