Linux SSH Connection Super slow solution.

Source: Internet
Author: User
Tags ssh server

The connection was slow recently when SSH was connected to a Linux server. Waited for about more than 40 seconds. To connect and start thinking that there is a problem with the network line. The troubleshooting found that no other Linux was in the same situation. Finally, the configuration of SSH was set up and optimized to solve this problem.


1. Turn off DNS reverse resolution

In Linux, the reverse parsing of SSH is turned on by default, which can affect the connection speed of SSH.

[Email protected]_365 ~]# Vim/etc/ssh/sshd_configusedns No


2. Turn off GSS authentication in SSH.

The GSS is an authentication method in SSH. Generally not used. So turn it off to increase the connection speed of SSH.

[Email protected]_365 ~]# vim/etc/ssh/sshd_configgssapiauthentication No


3. Modify the nsswitch.conf on the SSH server

[[Email protected]_365 ~]# vim/etc/nsswitch.confhosts:files DNS changed to Hosts:files

Hosts:files DNS: The order of domain name resolution, first through the local file parsing (/etc/hosts), if the resolution is not successful through the DNS resolution.


General modification of the 1, 22 steps to solve the problem. 3 steps. Modification is not recommended. If the server has to access other servers through the domain name . The modification may cause the domain name resolution to fail.


Modify to complete the above content. Restart the sshd service.


This article is from "Desert Camel" blog, please make sure to keep this source http://maomaochong.blog.51cto.com/9260445/1930935

Linux SSH Connection Super slow solution.

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.