Solve the problem of slow ssh connection

Source: Internet
Author: User
UseDNSyes is set in the sshd service. when the configured DNS server becomes inaccessible, it may take 10 to 30 seconds to connect to the server. Because UseDNS is used, the sshd server will reverse resolve the ip address connecting to the client, even in the LAN. When the connection is fast at ordinary times and suddenly becomes abnormal and slow, it may be because the DNS configured on the sshd server is invalid. for example, the DNS is configured on the Internet, and the external server is disconnected due to a fault. The ultimate solution is not to use UseDNS, in the configuration file/

UseDNS yes is set in the sshd service. when the configured DNS server becomes inaccessible, it may take 10 to 30 seconds to connect to the server. Because UseDNS is used, the sshd server will reverse resolve the ip address connecting to the client, even in the LAN.

When the connection is fast at ordinary times and suddenly becomes abnormal and slow, it may be because the DNS configured on the sshd server is invalid. for example, the DNS is configured on the Internet, and the external server is disconnected due to a fault. The ultimate solution is not to use UseDNS. in the configuration file/etc/sshd_config (some linux distributions find UseDNS in/etc/ssh/sshd_config) and set its value to no, if there is a # sign in front, remove it and restart the sshd server.


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.