Centos 7 SSH connection timeout automatic disconnect solution

Centos 7 SSH connection timeout automatic disconnect solution Centos 7 SSH connection timeout automatic disconnect solution

I recently installed the software on Centos  7, and it was automatically disconnected after a while, and I didn't know how the software installation progressed. In a fit of rage, I directly changed the sshd_config file, and I instantly felt better.

1. Edit the sshd configuration file

# vi /etc/ssh/sshd_config

    turn up

    #ClientAliveInterval 0
    #ClientAliveCountMax 3

    change into

    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 if it is not operated for a long time.

The original text comes from: https://www.linuxprobe.com/connection-timed-out.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325748203&siteId=291194637