(Summary) set up SSH in Linux
The server maintains a persistent connection and is published in: Linux, personal diary |
Author: Mou world global operator label: Linux, server, ssh, keep connection, summary, set, long time
OpenSSH is based on security reasons. If the user is idle for a period of time after connecting to the SSH server
The server automatically terminates the SSH connection after the specified time. I am used to connecting for a long time and need to make the following changes:
1. Open the SSH configuration file: # Vim/etc/ssh/sshd_config
You can save the following two parameters:
Tcpkeepalive Yes
Clientalive countmax 360
Note: The previous parameter indicates the TCP connection to be retained, and the last parameter indicates the number of minutes after the client's SSH connection is idle.
2. Restart sshd to take effect:
/Etc/init. d/sshd restart
Note: This method is applicable to all Linux releases of OpenSSH.