为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

SecureCRT ssh连接自动断开问题

2017-10-26 3页 doc 15KB 17阅读

用户头像

is_721103

暂无简介

举报
SecureCRT ssh连接自动断开问题SecureCRT ssh连接自动断开问题 当用SSH Secure Shell连接Linux时,如果几分钟没有任何操作,连接就会断开,必须重 新登陆才行,每次都重复相同的操作,很是烦人,本文总结了两种解决的方法。 方法1:更改ssh服务器的配置文件/etc/ssh/sshd_config ClientAliveInterval指定了服务器端向客户端请求消息的时间间隔, 默认是0,不发送。 而ClientAliveInterval 60表示每分钟发送一次,然后客户端响应,这样就保持长连接了。 这里比较怪的地方是:不是客户...
SecureCRT ssh连接自动断开问题
SecureCRT ssh连接自动断开问题 当用SSH Secure Shell连接Linux时,如果几分钟没有任何操作,连接就会断开,必须重 新登陆才行,每次都重复相同的操作,很是烦人,本文总结了两种解决的。 方法1:更改ssh服务器的配置文件/etc/ssh/sshd_config ClientAliveInterval指定了服务器端向客户端请求消息的时间间隔, 默认是0,不发送。 而ClientAliveInterval 60示每分钟发送一次,然后客户端响应,这样就保持长连接了。 这里比较怪的地方是:不是客户端主动发起保持连接的请求(如FTerm, CTerm等),而是需要 服务器先主动。 另外,至于ClientAliveCountMax,使用默认值3即可。ClientAliveCountMax表示服务 器发出请求后客户端没有响应的次数达到一定值,就自动断开,正常情况下,客户端不会不 响应。 ClientAliveCountMax Sets the number of client alive messages (see below) which may be sent without 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 ses-sion. 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 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. This option applies to protocol version 2 only. 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. This option applies to protocol version 2 only. vim /etc/ssh/sshd_config 找到ClientAliveInterval 参数,如果没有就自己加一行。 ClientAliveInterval 参数的数值是秒,比如你设置为540,就是9分钟. ClientAliveInterval 540 对于ClientAliveCountMax 指如果发现客户端没有相应,则判断一次超时,这个参数设置允许超时的次数,比如10。 ClientAliveInterval 540 ClientAliveCountMax 10; 则代表允许超时 5400秒 = 90分钟。 方法2:配置客户端 1 linux下的ssh命令 vim /etc/ssh/ssh_config 然后找到里面的ServerAliveInterval 参数,如果没有你同样自己加一个就好了。参数意义相同,都是秒数,比如9分钟: ServerAliveInterval 540 从服务器方面入手: 修改/etc/ssh/sshd_config配置文件 ClientAliveInterval 300(默认为0) 这个参数的是意思是每5分钟,服务器向客户端发一个消息,用于保持连接 service sshd reload 生效 2 SecureCRT 设置反空闲 SecureCRT 会话选项 推荐:会话选项 –> 终端 –> 反空闲–>发送 NO-OP(p) 每 60 秒 测试下来挺稳定,连国外服务器,不自动断开了 3 Putty 启用putty keepalive putty -> Connection -> Seconds between keepalives ( 0 to turn off ),默认为0, 改为60。
/
本文档为【SecureCRT ssh连接自动断开问题】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
热门搜索

历史搜索

    清空历史搜索