ssh一旦没有操作就很容易中断?通过两种方式配置保活机制:

1、服务端配置

sudo vim /etc/ssh/sshd_config,输入以下内容:

ClientAliveInterval 30
ClientAliveCountMax 60

重启ssh,sudo service ssh restart

2、客户端配置

sudo vim /etc/ssh/sshd_config,输入以下内容:

ServerAliveInterval 30
ServerAliveCountMax 60

重启ssh,sudo service ssh restart

转自:https://m.toutiao.com/is/dJ9Nqj9/