Solve the problem of automatic disconnection of SSH idle for some time under Mac

Source: Internet
Author: User

Before the company encountered this problem, the use of SSH login to the Linux server, in the background for a period of time, you will find the automatic disconnection, the solution is simple:

Vim/etc/ssh/ssh_config

Add these 2 sentences to

Serveralivecountmax 3

Serveraliveinterval 5

1.ServerAliveCountMax 3 indicates that the client does not respond to a certain number of times after the server makes a request and disconnects automatically. Normally, the client does not respond.

2.SerAliveInterval 0: Specifies the server-side time interval for requesting messages from clients, which is 0 by default, not sent,

and serveraliveinterval 5: indicates that every 5 seconds is sent to the server, which keeps the connection long

3./etc/ssh/directory In addition to Ssh_config, there is a sshd_config, the difference is that the former is for the client configuration file, the latter is for the server side of the file, because we are as clients to remote connection to other servers, so modify Ssh_ Config file is good.

Solve the problem of automatic disconnection of SSH idle for some time under Mac

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.