16th Mar, 2007

如何設定 putty / SSH 保持連線

部份的路由器(Router) 將沒有資料傳送的連線截斷, 對 SSH 來說是一件極不方便的事。要應付的話可從兩方面著手:

1. Putty -> Configuration -> Connection -> Options controlling the connection

將 Sending of null packets to keep session active 內的 Seconds between keepalives (0 to turn off) 設到 0 以上。個人喜好是30, 你亦可由一個比較長的時間慢慢調低。

2. /etc/ssh/sshd_config 內兩以下兩行

ClientAliveInterval 30ClientAliveCountMax 4

相關文章

你的回應






Your response: