CentOS 7 SSH connection timeout automatic disconnection solution

Time:2021-6-1

When using SSH to log in to Linux, because the default connection timeout is very short, it is often disconnected. You can modify the configuration file, adjust the time interval between the server and the client, and solve the problem of automatic disconnection.

edit/etc/ssh/sshd_config

find

#ClientAliveInterval 0
#ClientAliveCountMax 3

Amend to read

ClientAliveInterval 60
ClientAliveCountMax 10

Restart sshd service

systemctl restart sshd

After this adjustment, the connection will not be interrupted even if it is not operated for a long time

This work adoptsCC agreementReprint must indicate the author and the link of this article

Write the code.Change the world.

Recommended Today

Hot! Front and rear learning routes of GitHub target 144K

Hello, Sifu’s little friend. I’m silent Wang Er. Last week, while appreciating teacher Ruan Yifeng’s science and technology weekly, I found a powerful learning route, which has been marked with 144K on GitHub. It’s very popular. It covers not only the front-end and back-end learning routes, but also the operation and maintenance learning routes. As […]