远程链接oracle出现超时,ssh 远程链接服务器,经常会超时的解决方法

ssh 远程链接服务器,经常会超时的解决办法

env redhat 5

ssh远程链接服务器,经常会超时的解决办法

[oracle@hadoop ~]$ Read from remote host 121.248.200.15: Connection reset by peer

Connection to 121.248.200.15 closed.

如果ssh client 窗口在几分钟内没有键盘操作的时候 会话就会超时断线,通过修改sshd的配置文件 能够让ssh server 发送“心跳”信号来维持持续链接,

打开服务器/etc/ssh/sshd_config 文件 最后添加一行

ClientAliveInterval 60 指定了服务器端向客户端请求消息的时间间隔, 默认是0, 不发送.而ClientAliveInterval 60表示每分钟发送一次, 然后客户端响应, 这样就保持长连接了

ClientAliveCountMax 1  表示服务器发送请求后,客户端没有响应的次数达到了一定的值,就会自动断开。

PS

引用

[oracle@hadoop ~]$ man sshd_config

ClientAliveCountMax

Sets the number of client alive messages (see below) which may be sent with-out 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 an d 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 connection 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.

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值