ssh保持链接

  1. 1. Client configuration
  2. 2. Server configuration

Client configuration

Try creating the file: ~/.ssh/config
Add the contents:

1
2
3
Host *
ServerAliveInterval 30
ServerAliveCountMax 5

Server configuration

Edit configuration file: /etc/ssh/sshd_config

1
2
ClientAliveInterval 20
ClientAliveCountMax 5