Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I see there are 3 parameters of importance in the ssh_config file :

TCPKeepalive
ServerAliveInterval
ServerAliveCountMax

1) When I try ssh with tcpkeepalive=yes, the ssh conenction does not get disconnected within in 140 secs even though the tcp_keepalive parameters are set as:

tcp_keepalive_intvl 20 
tcp_keepalive_probes 5
tcp_keepalive_time   40

What do I need to check for to see why the disconnect is not happening within 140 secs ?

2) Can we use all the above 3 parameters at the same time ? Or should we use either the TCP timeout or the ssh server alive parameters ? If I use only the serveralive* parameters, the disconnect happens pretty quick. But I am seeing why the tcpkeepalive timeout is not happening.

Can you please help ?

share|improve this question

migrated from stackoverflow.com May 9 '13 at 19:54

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

1 Answer 1

up vote 0 down vote accepted

TCPKeepalive refers to the amount of time waited before a client that appears to be dead is disconnected. If you are still logged in over SSH, you're not dead. In TCP terms, dead means doesn't respond to the probe. This has nothing to do with whether you're at the computer or not, or how long the SSH session has been open, as long as your computer is on, connected to the internet, and still in the session, it will be kept alive. TCPKeepalive is more for people who get disconnected frequently, if they set their TCPKeepalive to a fairly long time, if they get disconnected, they have in your case, 140 seconds to reconnect before the session is dropped as dead.

I guess my question would be, if you don't want the connection to stay alive longer, why are you using TCPKeepalive? Asked purely so we can help with whatever the cause issue is, that's not supposed to sound as sarcastic as it does.

share|improve this answer

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.