Client connection Linux regular interval broken links

Source: Internet
Author: User

Cause

When using SECURECRT to access Linux via telnet or SSH, there is always an issue where the connection prompt will be disconnected after a period of time. Initially thought is caused by network instability, but I test found in the server can always ping the client IP, the same client can ping the server, so the network should be no problem (Linux installed in the virtual machine, network mode is set to bridge, the router is not a problem).
Trial of the latest 64-bit securecrt (native WIN7 64-bit, started with 32-bit SECURECRT), Putty Client still has this problem, so the software incompatibility problem is also excluded.

Finally through a variety of groping, finally know the main cause of the problem, because the connection is possible, but will be time-out disconnection, according to the network structure, the problem may appear in some of these parts

    1. The server has a firewall that either closes the timeout idle connection, or sets the shutdown timeout idle connection.
    2. There is a router between the customer service and the server, and the router may have a firewall, which turns off the idle connection over time.
    3. There is a firewall on the customer service side, which closes the timeout idle connection.
Solution Ideas


Knowing the problem, we have a solution:

Since the problem is the idle connection that will disconnect the timeout, then we can make the connection between the client and the server "not Idle",you can start with the server:

This requires server permissions to modify the/etc/ssh/sshd_config configuration file Clientaliveinterval 300 (the default is 0, if there is "#" in front of the option, it is commented out need to open, while tcpkeepalive Also need to be set to Yes) This parameter 300 means that every 5 minutes, the server sends a message to the client to keep the connection, of course the value is smaller than the minimum value of your three firewall timeout, otherwise the connection will be disconnected if you have not waited to send the idle packet.
After the modification using the service sshd Reload command to take effect, this modification applies to all terminal connections, but does not support Telnet mode connection, SSH mode can remain connected.

You can also start with the client:

If there is no server permissions can be used to change the client's way to make the connection between the client and the server "not idle", the idea is the same as how often the client sends a message to the server, to keep the connection, the above mentioned two clients securecrt and putty can be set, The time here also needs to be smaller than the minimum value of your three firewall timeout time.
SECURECRT sets the number of seconds to send a string, or the No-op protocol package, in the option Terminal counter-idle.
Putty:putty, Connection, Seconds between keepalives (0 to turn off), default is 0, change to 300.

In addition to the use of firewalls, of course, you can also change the firewall to solve the problem

Directly disable the firewall can be implemented, but the security of the entire network is a problem, to configure the rules of the three firewall is also to let people compare vomit, here do not repeat, have patience of friends can try.

Summarize


Finally, it is recommended to use the client to send message packets, the operation is simple, do not modify the server files, only for themselves, network security can be guaranteed, and the increased message packet will not cause any network burden.
The above information on the Internet and personal understanding, here to share, if there is an incorrect expression of the place want to point out, joint learning common Progress, by kylin9578 (Chengdu 51testing 17th students)

Reference from http://bbs.51testing.com/thread-987133-1-1.html

Client connection Linux regular interval broken links

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.