Sunday, January 19, 2014

Raspberry Pi Fixing SSH Slow Password Prompt

I have two raspberry pis at home one is always on a web  cam connected to it and it lets me view my aquarium when i want over the internet :) The other i use to experiment with various stuff ranging from reading electrical meters to trying to attach sensors to its GPIO.

Most of the time i am using ssh to login and do stuff on my raspberry pis. They are attached to my home private network and i use putty to do ssh connections to them. The user prompt appears with no delay at all. However it takes quite some time for the password prompt to appear ( taking up to 30 seconds on some occasions ). While searching ubuntu forums for another thing i came across below post about slow password prompt:

And i wanted to give it a try. I did login to raspberry pi via ssh and run below command, if you dont have vim you can use nano as well.

sudo vim /etc/ssh/sshd_config

Find the line UseDNS in the sshd_config file and if it exists change it to "no". If it does not exist go to the very end of the line and add a new line "UseDNS no". When you are done save the file.

Restart ssh service using command

sudo service ssh restart

Close your ssh and re-connect this time (hopefully) you will get the password prompt instantly :).

No comments:

Post a Comment