6

I understand what each one of the alive count max do , but I can't seem to find answer for the following :

ServerAliveCountMax Sets the number of server alive messages (see below) which may be sent without ssh(1) receiving any messages back from the server. If this threshold is reached while server alive messages are being sent, ssh will disconnect from the server, terminating the session

Let's say ServerAliveInterval is 15 and ServerAliveCountMax 10 . if the server was unresponsive for 3 serverAliveInterval (45 seconds) , then it becomes responsive . after that it becomes unresponsive again , will the serverAliveCountMax continue for the 7 remaining trials ( 15 * 7 )? or it start counting from 0 to 10 ( 15 * 10 )? in other words does this counter reset if it becomes responsive ?

1 Answer 1

6

The key here is "without ssh(1) receiving any messages back from the server". The man page for the two parameters ServerAliveInterval and ServerAliveCountMax in ssh_config writes

ServerAliveCountMax Sets the number of server alive messages (see below) which may be sent without ssh(1) receiving any messages back from the server. If this threshold is reached while server alive messages are being sent, ssh will disconnect from the server, terminating the session. [...]

ServerAliveInterval Sets a timeout interval in seconds after which if no data has been received from the server, ssh(1) will send a message through the encrypted channel to request a response from the server. [...]

You can see that the counters are reset as soon as any message is received back from the server. The message might be a response to a Keep Alive request, or it might be in-band data; that doesn't really matter to the timers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .