Improving security for SSH
There are two things to increase the security for ssh logins.
Change SSH PortTo change the SSH port, simply edit the sshd_config file with the commmand
sudo nano /etc/ssh/sshd_configand change the line
Port 22to something higher. Make sure to stay below 65,000 and don’t use any port which is already used by another service like 80 (web). After changing and saving the file, simply restart the ssh daemon and reload the configuration with
sudo /etc/init.d/ssh reload. Done.
Disable password based login for SSHTo disable the password based login for all the users, you can do the following:
Disable password authentication with the following settings:
# Open the sshd config file sudo nano /etc/ssh/sshd_config
Allow private public key authentication with the following:
Once this is done, restart the SSH daemon to apply the settings.
RSAAuthentication yes PubkeyAuthentication yes
Additional information can be found here.