Wait for a moment before you can connect to and close UseDNS to accelerate SSH login.

Source: Internet
Author: User

Users who often log on to SSH can feel that every time they log on to SSH, they always have to wait for a moment to connect. This is because the OpenSSH server has a DNS search option, UseDNS is enabled by default.

When the UseDNS option is enabled, when the client attempts to log on to the SSH server, the server first performs dns ptr lookup Based on the client's IP address to obtain the client's host name, then, the DNS is querying the record based on the client host name to verify whether it is consistent with the original IP address. This is A measure to prevent Client Spoofing, however, we generally do not have PTR records for Dynamic IP addresses. Opening this option is just a waste of time. It is better to disable it.

I. editing files


Vim/etc/ssh/sshd_config

2. Find the following characters


# UseDNS yes

Create a new row under it and enter


UseDNS no

3. Save and restart SSH


Service sshd restart

A few simple steps are completed.

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.