SSH会话连接超时问题
来源:互联网 发布:软件研发阶段 编辑:程序博客网 时间:2024/04/29 22:39
1、 配置服务器
#vi /etc/ssh/sshd_config
1)找到 ClientAliveInterval参数,如果没有就自己加一行
ClientAliveInterval 120
2)ClientAliveCountMax
指如果发现客户端没有响应,则判断一次超时,这个参数设置允许超时的次数。如3 、5等自定义
ClientAliveInterval 120
ClientAliveCountMax 3 ### 0 不允许超时次数
重新加载sshd服务。退出客户端,再次登陆即可验证。
2、 配置客户端
#vi /etc/ssh/ssh_config
ServerAliveInterval
ServerAliveInterval 300
下面是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
- SSH会话连接超时问题
- SSH会话连接超时问题
- 解决ssh会话连接超时问题
- 阿里云ECS Linux解决SSH会话连接超时问题
- ssh连接会话超时时间的方法
- ssh连接的超时掉线问题
- 解决ssh超时断开连接的问题
- 解决ssh超时断开连接的问题
- ssh连接超时自动logout问题
- linux终端ssh连接超时问题记录
- session会话超时问题
- SSH 连接超时解决办法
- ssh连接超时解决方法
- ssh连接超时解决办法
- 设置ssh连接超时
- SSH连接超时解决方法
- SSH远程连接设置 保持Crt会话不因超时中断
- SSH Client 会话空闲超时的解决办法
- weblogic 解析jsp报错
- C++XML操作之四---CMarkup使用实例
- Hge系列教材(6) --- 程序流程与细节
- 关于N9的一个笑话(真实事件,手机被偷后)
- c语言静态变量和静态函数
- SSH会话连接超时问题
- poj 3461 Oulipo
- squid代理原理与配置
- C++操作XML经验总结
- 设置SOCKET的发送与接收缓冲区 .
- 1.复合主键:Object,hbm
- 并查集 xtu-2170 ACM ICPC 2011–2012, Northeastern European Regional Contest Problem E. Eve
- HGE 系列教材(7) --- 使用 Helper Classes
- 序列化:Serializable和Externalizable