Wednesday, September 7, 2011

Resolving Slow SSH Login

If you are facing slow login times, it might be due to reverse DNS is not responding quick enough. This system can show up on your log file

# tail -50 /var/log/secure


You will notice that there is a time lag from accepting the key to opening a session

Sep  6 10:15:42 santol-h00 sshd[4268]: 
Accepted password for root from 192.168.1.191 port 51109 ssh2

Sep  6 10:15:52 santol-h00 sshd[4268]: pam_unix(sshd:session): 
session opened for user root by (uid=0)

To fix the issue, you should modify the /etc/ssh/sshd_config file

# vim /etc/ssh/sshd_config

At /etc/ssh/sshd_config, change UseDNS  no
#ShowPatchLevel no
UseDNS no
#PidFile /var/run/sshd.pid

Restart the ssh service

# service sshd restart

Feel the login speed :)

2 comments:

Eli said...

hi

done that. it's dose not help me

efi

kittycool said...

Is your connection slow due to multiple SSH connection to the same Server? You may want to Look at http://www.linuxjournal.com/content/speed-multiple-ssh-connections-same-server