ssh 闲时断开连接
ClientAliveCountMax
Sets the number of client alive messages which may be sent with-
out sshd(8) receiving any messages back from the client. If this
threshold is reached while client alive messages are being sent,
sshd will disconnect the client, terminating the session. It is
important to note that the use of client alive messages is very
different from TCPKeepAlive. The client alive messages are sent
through the encrypted channel and therefore will not be spoofa-
ble. The TCP keepalive option enabled by TCPKeepAlive is spoofa-
ble. The client alive mechanism is valuable when the client or
server depend on knowing when a connection has become inactive.
The default value is 3. If ClientAliveInterval is set to 15, and
ClientAliveCountMax is left at the default, unresponsive SSH
clients will be disconnected after approximately 45 seconds.
ClientAliveInterval
Sets a timeout interval in seconds after which if no data has
been received from the client, sshd(8) will send a message
through the encrypted channel to request a response from the
client. The default is 0, indicating that these messages will
not be sent to the client.
这两个值相乘 出来的秒数是 闲时 断开时间
官网地址 sshd_conf 找 sshd Config Manual Pages

浙公网安备 33010602011771号