Solve the problem of automatic disconnection after ssh is idle for a period of time

Source: Internet
Author: User
Use a client tool, such as securecrt, to connect to a linux server. some of them may be disconnected after a period of time without any operation. This is mainly because the vro and firewall exist between the client and the server, and the idle connection will be disconnected after the specified time for its own security. Or the server is set to disconnect idle connections. There are two solutions: one is to start from the server, and the other is to start and release the client tool. Modify/etc/ssh/sshd_config on the server

Use a client tool, such as securecrt, to connect to a linux server. some of them may be disconnected after a period of time without any operation. This is mainly because the vro and firewall exist between the client and the server, and the idle connection will be disconnected after the specified time for its own security. Or the server is set to disconnect idle connections. There are two solutions: one is to start from the server, and the other is to start and release the client tool.

  • Server

Modify the ClientAliveInterval 300 (default value: 0) in the/etc/ssh/sshd_config configuration file. the parameter indicates that the server sends a message to the client every five minutes to maintain the connection, use service sshd reload to make the modification take effect. If the problem persists, set 300 to a smaller value, for example, 60.

  • Client Tools

Securecrt settings:Session options?> Terminal?> Anti-idle?> Select the Send Protocol NO-OP (p) every 60 seconds

Putty setting method:Putty-> Connection-> Seconds between keepalives (0 to turn off). The default value is 0, which is changed to 300.


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.