分类: LINUX
2011-12-21 09:55:53
下面是man sshd_config获取的描述信息
ClientAliveInterval
Sets a timeout interval in seconds after which if no data has
been received from the client, sshd 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. This option applies to protocol version 2
only.
ClientAliveCountMax
Sets the number of client alive messages (see above) which may
be sent without sshd receiving any messages back from the
client. If this threshold is reached while client alive mes-
sages are being sent, sshd will disconnect the client, terminat-
ing 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 mecha-
nism is valuable when the client or server depend on knowing
when a connection has become inactive.
The default value is 3. If ClientAliveInterval (above) is set
to 15, and ClientAliveCountMax is left at the default, unrespon-
sive ssh clients will be disconnected after approximately 45
seconds.
3、echo export TMOUT=1000000 >> /root/.bash_profile; source .bash_profile
在Linux 终端的shell环境中通过设置环境变量TMOUT来阻止超时。如果显示空白,表示没有设置, 等于使用默认值0, 一般情况下应该是不超时. 如果大于0, 可以在如/etc/profile之类文件中设置它为0.
Definition: TMOUT: If set to a value greater than zero, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if input does not arrive
,转载地址。