If SSHing to your VPS is slow especially during the login stage then this could be down to UseDNS being switched on in your sshd_config file. In order to speed up the login process and improve overall responsiveness of your SSH session it is necessary to switch UseDNS off. In order to do this please do the following:
- SSH into your VPS.
- If your using a Debian based linux distro type in
and press enter. Otherwise please refer to the documentation for your particular linux distro. To find your distro from the command line please see my post here.
- In sshd_config look for UseDNS yes and replace with UseDNS no.
- If the line doesn’t exist at all, add UseDNS no to the end of the file.
- Press ctrl+x to close and press Y to Save sshd_config.
- Restart the SSH daemon and you’re good to go.
sudo /etc/init.d/ssh restart
SSH responsiveness should improve dramatically. For more information regarding sshd_config please refer to it’s man page here.