How to fix delay in SSH login in Centos

Have you ever faced login delays when you tried to connect to the Linux systems, if yes this is happening due to reverse DNS look-up query that is been made to DNS Server.

We can fix this issue as mentioned below steps:

1) Take /etc/ssh/sshd_config backup

# cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.`date '+%m-%d-%Y_%H:%M:%S'`

2) Edit /etc/ssh/sshd_config on sshd Server

#vi /etc/ssh/sshd_config

And add this DNS option to the file:
UseDNS no

3) Now add the following line to your 

#vi /etc/resolv.conf
options single-request-reopen

4) Restart ssh daemon

# systemctl restart sshd
# systemctl status sshd 

No comments:

Post a Comment