找回密碼 或 安全提問
 註冊
|註冊|登錄

伊莉討論區

搜索
儲值後自動升級用戶組搞笑、娛樂、精彩的影片讓你看安全提問(回答) 和 永久尊貴會員 事宜
上原亞衣偷拍銀魂siromg 無碼mg安卓
mg 無碼ebwh 133痴漢我在東京work 003]應該說pppe 245

休閒聊天興趣交流學術文化旅遊交流飲食交流家庭事務PC GAMETV GAME
熱門線上其他線上感情感性寵物交流家族門派動漫交流貼圖分享BL/GL
音樂世界影視娛樂女性頻道潮流資訊BT下載區GB下載區下載分享短片
電腦資訊數碼產品手機交流交易廣場網站事務長篇小說體育運動時事經濟
上班一族博彩娛樂

[繁]為何我的世界被遺

[簡]雙生戀情密不可分

[繁]曾經、魔法少女和

2024年10月「七龍珠DA

[簡]雙生戀情密不可分

[繁]從路人角色開始的
WINDOWS 分享區LinuxWINDOWS討論MAC OS X
查看: 6192|回復: 3
打印上一主題下一主題

[分享]解決遠端 SSH 登入 TimeOut 的問題[複製鏈接]

spen1003 該用戶已被刪除
跳轉到指定樓層
樓主
發表於 2010-1-27 01:05 PM|只看該作者|正序瀏覽
若有安裝色情守門員,可用無界、自由門等軟件瀏覽伊莉。或使用以下網址瀏覽伊莉: http://www.eyny.com:81/index.php

原來的ssh是不會超時的, 但是自從上次給ubuntu Server 系統升級後, 出現了ssh 超時現象:只要putty連續3分鐘左右沒有輸入, 就自動斷開, 然後必須重新登陸, 很麻煩.

在網上查了很多資料, 發現原因有多種, 環境變量TMOUT引起,ClientAliveCountMax和ClientAliveInterval設置問題或者甚至是防火牆的設置問題. 所以可以這麼嘗試:


1, echo $TMOUT
如果顯示空白,表示沒有設置, 等於使用默認值0, 一般情況下應該是不超時. 如果大於0, 可以在如/etc/profile之類文件中設置它為0.
Definition: TMOUT: If set to a value greater than zero, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if input does not arrive.
2. ClientAliveInterval 60
在/etc/ssh/sshd_config中增加ClientAliveInterval 60, ClientAliveInterval指定了服務器端向客戶端請求消息的時間間隔, 默認是0, 不發送.而ClientAliveInterval 60表示每分鐘發送一次, 然後客戶端響應, 這樣就保持長連接了.這裡比較怪的地方是:不是客戶端主動發起保持連接的請求(如FTerm, CTerm等),而是需要服務器先主動.

另外,至於ClientAliveCountMax, 使用默認值3即可.ClientAliveCountMax表示服務器發出請求後客戶端沒有響應的次數達到一定值, 就自動斷開. 正常情況下, 客戶端不會不響應.(spen註.這參數應該是與 上面的 ClientAliveInterval 相對應.ClientAliveCountMax 代表 執行 ClientAliveInterval 時間的 【次數】. sshd_config 有一段(man sshd_config) 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.
------

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 mes-
sages is very different from TCPKeepAlive (below). The client
alive messages are sent through the encrypted channel and there-
fore will not be spoofable. The TCP keepalive option enabled by
TCPKeepAlive is spoofable. The client alive mechanism is valu-
able when the client or server depend on knowing when a connec-
tion has become inactive.

The default value is 3. If ClientAliveInterval (see below) is
set to 15, and ClientAliveCountMax is left at the default, unre-
sponsive 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 ver-
sion 2 only.

3. 啟用putty keepalive
putty -> Connection -> Seconds between keepalives ( 0 to turn off ), 默認為0, 改為60.

4. 上述3個方法應該能解決大部分問題, 如果不行, 請 man sshd_config, 然後嘗試更改其他設置吧.

...
瀏覽完整內容,請先 註冊登入會員
分享分享0收藏收藏0支持支持0

使用道具檢舉

LuWei 該用戶已被刪除
4
發表於 2011-4-16 05:56 PM|只看該作者
感恩  這個問題之前一直有遇到  沒有去找答案  現在知道了  thanks
若瀏覽伊莉的時侯發生問題或不正常情況,請使用Internet Explorer(I.E)。

使用道具檢舉

sean117178 該用戶已被刪除
3
發表於 2011-4-11 12:24 PM|只看該作者
若瀏覽伊莉的時侯發生問題或不正常情況,請使用Internet Explorer(I.E)。
感謝大大分享~ 我先來去try 看看
所有積分大於負-100的壞孩子,將可獲得重新機會成為懲罰生,權限跟幼兒生一樣。

使用道具檢舉

帖子
198
積分
0 點
潛水值
34130 米
頭香
發表於 2010-2-4 08:39 AM|只看該作者
若對尊貴或贊助會員有任何疑問,歡迎向我們查詢。我們的即時通或MSN: admin@eyny.com

使用道具檢舉

您需要登錄後才可以回帖 登錄 | 註冊

Powered by Discuz!

© Comsenz Inc.

重要聲明:本討論區是以即時上載留言的方式運作,對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。 由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿上傳和撰寫 侵犯版權(未經授權)、粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。
回頂部