(Summary) set up an SSH server in Linux to maintain a persistent connection

Source: Internet
Author: User
Tags ssh server

(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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.