Keep Ubuntu ssh persistent connections

Source: Internet
Author: User
The ssh connection in Ubuntu is always disconnected. If you ignore it for a while, you will lose the response. How can you keep the ssh connection server or sshtunnel connected? In fact, it is also very convenient, as long as you add two parameters to the/etc/ssh/ssh_config file, the first parameter 1TCPKeepAliveyes2ServerAliveInterval300 is to maintain the connection, the next parameter table indicates that a packet is sent to the server every five minutes, indicating "I am still alive"

The ssh connection in Ubuntu is always disconnected. If you ignore it for a while, the response will be lost.

How can I keep the ssh connection to the server or ssh tunnel?

In fact, it is very convenient. Just add two parameters to the/etc/ssh/ssh_config file.

1 TCPKeepAlive yes

2 ServerAliveInterval 300

The previous parameter indicates to keep the connection. The next parameter table indicates that a packet is sent to the server every five minutes, indicating "I am still alive"

If you do not have the root permission, modify or create ~ /. Ssh/ssh_config is also possible

Related Article

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.