Chinaunix

标题: SSH 连接问题 [打印本页]

作者: BHR_kramer    时间: 2013-01-08 15:29
标题: SSH 连接问题
首先是我对这三个参数的理解,如果不对请指教

ClientAliveInterval
这个参数在服务器端配置。
比如配置 ClientAliveInterval 60 则服务器端每60秒对客户端发一次探测,客户端会自动回应


ClientAliveCountMax
这个参数在服务器端配置
比如配置 ClientAliveCountMax 5则服务器端会给客户端5次机会,就是判断一次超时后,不会马上断开连接,而是累计5次才断开。[fly]多长时间判断一次超时不知道[/fly]




ServerAliveInterval
这个参数在客户端配置
如果配置成 ServerAliveInterval 60 则是客户端每60秒去通知服务器一次,表示自己还存在

如果这3个的理解都正确,那么SSH上如何配置在一定时间断开一个idle的session呢? 比如有一个参数 IDLE_TIME 600 就是说过了600秒,10分钟,如果一个客户端还没有主动发来信息就关闭这个客户端
作者: chenyx    时间: 2013-01-08 15:38
ClientAliveCountMax
             Sets the number of client alive messages (see below) which may be sent without sshd 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 (below).  The client alive messages are sent through the encrypted channel and therefore will not be spoofable.
             The TCP keepalive option enabled by TCPKeepAlive is spoofable.  The client alive mechanism is valuable when the client or server depend on knowing when a con-
             nection has become inactive.

             The default value is 3.  If ClientAliveInterval (see below) is set to 15, and ClientAliveCountMax is left at the default, unresponsive ssh clients will be
             disconnected after approximately 45 seconds.





欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2