Code Ghar

SSH Login Takes a Long Time

Posted in configuration by hs on June 17, 2009

Has it ever happened to you that logging in to an SSH server takes a long time? More than, say 20, 30 seconds? Well, there are many solutions out there to fix it, some may even make your system less secure. So let’s go to the source of SSH, so to speak, for a resolution. If you head over to ssh(1) takes a long time to connect or log in, you will see that it’s an issue with DNS resolution. To resolve this issue, try the following steps:

You need to change the sshd config file …

sudo vim /etc/ssh/sshd_config

… and make sure you have this line uncommented

UseDNS no

Save the file and restart SSH daemon (service) like so

sudo service sshd restart (Fedora, Red Hat, CentOS)

or

sudo /etc/init.d/sshd restart (Debian, Ubuntu)

Hat tip: Slow SSH login;

Tagged with:

2 Responses

Subscribe to comments with RSS.

  1. Joel said, on June 18, 2009 at 7:21 pm

    Or, you could just, um, fix your broken dns?

  2. q said, on November 15, 2009 at 2:34 pm

    You do this on the ssh server, or on the client machine that you use to login?
    Thanks!


Leave a Reply