Solve the problem of slow connection of centos7 ssh

Sometimes ssh to connect to the server remotely, the following will be displayed, and it will be stuck there, and it will take several minutes to enter the linux system:

Connecting to 192.168.1.2:22...

Connection established.

To escape to local shell, press 'Ctrl+Alt+]'.

I checked the relevant information and found that a parameter in the ssh configuration file was working.

vi /etc/ssh/sshd_config

Set #UseDNS yes

Change to UseDNS no

Restart ssh to solve

service sshd restart

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325809923&siteId=291194637