ssh鏈接超時問題解決方案

ssh鏈接超時問題解決方案:html

1.修改server端的etc/ssh/sshd_config服務器

ClientAliveInterval 60 #server每隔60秒發送一次請求給client,而後client響應,從而保持鏈接ssh

ClientAliveCountMax 3 #server發出請求後,客戶端沒有響應得次數達到3,就自動斷開鏈接,正常狀況下,client不會不響應ui


2.修改client端的etc/ssh/ssh_config添加如下:(在沒有權限改server配置的情形下)spa

ServerAliveInterval 60 #client每隔60秒發送一次請求給server,而後server響應,從而保持鏈接.net

ServerAliveCountMax 3  #client發出請求後,服務器端沒有響應得次數達到3,就自動斷開鏈接,正常狀況下,server不會不響應unix


3.另外一種方式: orm

不修改配置文件server

在命令參數裏ssh -o ServerAliveInterval=60 這樣子只會在須要的鏈接中保持持久鏈接, 畢竟不是全部鏈接都要保持持久的htm

來自:http://blog.chinaunix.net/uid-10697776-id-3341317.html

相關文章
相關標籤/搜索