正文

terminal timeout

(2019-01-25 13:51:04) 下一個

https://bjornjohansen.no/ssh-timeout

 

 

Prevent SSH timeout on the client side

If you’re on Mac or Linux, you can edit your local SSH config file in ~/.ssh/configand add the following line:

ServerAliveInterval 120

This will send a “null packet” every 120 seconds on your SSH connections to keep them alive.

Prevent SSH timeout on the server side

If you’re a server admin, you can add the following to your SSH daemon config in /etc/ssh/sshd_config on your servers to prevent the clients to time out – so they don’t have to modify their local SSH config:

ClientAliveInterval 120ClientAliveCountMax 720

This will make the server send the clients a “null packet” every 120 seconds and not disconnect them until the client have been inactive for 720 intervals (120 seconds * 720 = 86400 seconds = 24 hours).

[ 打印 ]
閱讀 ()評論 (0)
評論
目前還沒有任何評論
登錄後才可評論.