Recently, I was installing software on Centos 7, and it automatically disconnected after a while without looking at it. I didn’t know the progress of the software installation. I was so angry that I directly changed the sshd_config file, and I felt much better instantly.
1. Edit sshd configuration file
# vi /etc/ssh/sshd_config 找到 #ClientAliveInterval 0 #ClientAliveCountMax 3 修改为 ClientAliveInterval 60 ClientAliveCountMax 3
2. Restart the sshd service
# systemctl restart sshd
In this way, the connection to centos7 will not be interrupted by timeout even if it is not operated for a long time.
The above is the detailed content of Centos 7 SSH connection timeout automatic disconnection solution. For more information, please follow other related articles on the PHP Chinese website!