Howto fix delay in SSH Login

Howto fix delay in SSH Login

Question : How to fix delay in SSH Login ?

Answer  :

DNS lookup query is an SSH feature that you can find in most Linux distros, this feature is responsible for the  delay because SSH wait for a response of reverse DNS lookup query that is been made to DNS Server.

To overcome this issue, please follow these steps:

1- Edit  /etc/ssh/sshd_config  on sshd  Server

vi /etc/ssh/sshd_config

and add this DNS option to the file:

UseDNS no

save  and exit
2- Now add the following line to your /etc/resolv.conf.

options single-request-reopen

Restart  sshd  

 /etc/init.d/sshd  restart


  • Srba

    Doesn’t work in Ubuntu…delay is still here :(

  • Mad_skin

    worked 4 me using xubuntu 12.04

  • Rl Amorato

    Try adding this to ~/.ssh/config
    AddressFamily inet

  • Kasmodan

    If you see this = #useDNS no then it is allready commented out try turning off this then = GSSAPIAuthentication no

    that worked for me.

  • Mike Gillan

    Thanks, worked for me with Ubuntu 13.10.