成人免费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
相關推薦

2009-07-22 17:50:14

2010-07-15 14:01:12

telnet亂碼

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錯誤

2011-03-01 15:38:44

Fireftp亂碼

2010-02-23 13:07:07

CentOS gcc

2012-08-15 14:01:18

2010-11-16 16:07:32

oracle用戶連接

2011-06-27 09:23:05

Ubuntu密碼

2009-06-12 16:17:48

Hibernate l

2010-05-27 09:33:04

SVN沖突

2010-03-29 17:46:39

Nginx asp

2014-09-01 16:45:06

DNS域名劫持
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 亚洲精品一区中文字幕乱码 | 午夜久久av | 欧美性大战xxxxx久久久 | 在线不卡视频 | 欧美视频在线播放 | 日韩免费看片 | 羞羞视频网站 | 亚洲一区中文字幕在线观看 | 亚洲网站在线观看 | 成人a在线观看 | 国产精品欧美一区二区 | 午夜精品一区二区三区在线视频 | 国产视频一区二区三区四区五区 | 欧美日韩国产一区二区 | 亚洲第1页 | 久久久久免费精品国产小说色大师 | 人人做人人澡人人爽欧美 | 国产伦精品一区二区三区视频金莲 | 欧美日韩一区二区三区四区 | 国产一区二区三区视频 | 欧美激情五月 | 欧美aaa级 | 欧美jizzhd精品欧美巨大免费 | 亚洲视频在线一区 | 久久久久久黄 | 国产a区 | 免费av毛片 | 国产小网站 | 中文成人在线 | 午夜视频免费在线观看 | 福利精品在线观看 | 国产欧美精品在线 | 欧美日韩中文国产一区发布 | 国产成人免费视频网站高清观看视频 | 91麻豆精品国产91久久久久久久久 | 在线小视频 | 午夜影视| 亚洲欧美中文日韩在线v日本 | 日本精品一区二区三区视频 | 国产精品毛片一区二区在线看 | 午夜精品福利视频 |