Why Does It Takes a Long Time to Connect to an ECS Using SSH After UseDNS Is Enabled?
Symptom
It takes a long time to connect to an ECS using SSH.
Possible Causes
After the UseDNS option is enabled for the sshd service on the SSH server, when a client attempts to connect to the server using SSH, the server performs a DNS PTR reverse query to obtain the client's host name based on the client's IP address, and then performs a DNS forward A record query based on the client's host name, and check whether the two IP addresses are the same. This is a measure to prevent client spoofing. But in general, dynamic IP addresses do not have PTR records. Therefore, you are advised to disable this option.
You can run the following command to check whether UseDNS is enabled:
grep UseDNS /etc/ssh/sshd_config
If the value is yes or the line is commented out, UseDNS is enabled. Disable UseDNS by performing the following operations.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot