部份的路由器(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