成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

ssh超時斷開的解決方法

系統 Linux
當用SSH Secure Shell連接Linux時,如果幾分鐘沒有任何操作,連接就會斷開,必須重新登陸才行,每次都重復相同的操作,很是煩人,本文總結了兩種解決的方法。

當用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

2 SecureCRT

設置反空閑,如下圖所示

 securecrt_to

3 Putty

啟用putty keepalive

putty -> Connection -> Seconds between keepalives ( 0 to turn off ),默認為0,改為60。
 

【編輯推薦】

  1. Linux實戰:用SSH遠程管理RHEL 5
  2. 淺析Linux服務器OpenSSH的源碼編譯與升級
  3. RSH/SSH配置Linux之間互信連接
責任編輯:趙寧寧 來源: chinaitlab
相關推薦

2010-07-15 14:01:12

telnet亂碼

2009-07-22 17:50:14

2011-03-01 13:40:45

500 OOPS

2009-09-10 09:35:25

Linq語句

2010-10-13 17:22:12

MySQL查詢亂碼

2009-07-03 18:14:27

Servlet線程安全

2010-04-20 16:46:41

Oracle數據庫密碼

2023-04-06 15:21:34

IIoT自動化

2011-09-16 15:36:47

網絡環路

2010-05-25 16:37:47

MySQL忘記密碼

2011-05-16 09:54:22

mysql1067錯誤

2012-08-15 14:01:18

2011-06-27 09:23:05

Ubuntu密碼

2010-11-16 16:07:32

oracle用戶連接

2010-02-23 13:07:07

CentOS gcc

2011-03-01 15:38:44

Fireftp亂碼

2009-06-12 16:17:48

Hibernate l

2010-03-29 17:46:39

Nginx asp

2017-05-27 15:45:00

Windows 10Windows更新

2010-10-14 13:45:44

MySQL函數不能創建
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 凹凸日日摸日日碰夜夜 | 午夜三级网站 | 日本在线综合 | 欧美九九九 | 99re国产视频 | 国产精品久久久久久久久 | 欧美成人不卡 | 成人免费在线视频 | 国产日产久久高清欧美一区 | 日本一区二区不卡 | 亚洲国产精品激情在线观看 | 亚洲成人激情在线观看 | 亚洲一区中文字幕在线观看 | 色综合天天天天做夜夜夜夜做 | 国产精品久久久久久亚洲调教 | 81精品国产乱码久久久久久 | 亚洲免费网 | 黄网站色大毛片 | 欧美午夜一区 | 成人激情视频免费在线观看 | 99国产精品久久久久 | 精品一区视频 | 欧美日韩在线视频一区二区 | 国产高清在线观看 | 祝你幸福电影在线观看 | 免费在线视频一区二区 | 久久精品国产一区老色匹 | 国产精品久久久久久久一区探花 | 国产精品久久久久久久久久久久午夜片 | 亚洲一一在线 | 99热激情 | a黄视频 | 四虎在线视频 | 成人欧美一区二区三区色青冈 | 99免费视频 | 久在线| 亚洲视频在线看 | 91天堂网| 精产国产伦理一二三区 | 91精品久久久久久久99 | 国产成人亚洲精品 |