Improving security for SSH12 Feb 2016 by Friedrich Ewald · 1 min read
There are two things to increase the security for ssh logins.
Change SSH Port
To change the SSH port, simply edit the sshd_config file with the commmand
sudo nano /etc/ssh/sshd_config and change the line
Port 22 to 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 SSH
To disable the password based login for all the users, you can do the following:
# Open the sshd config file sudo nano /etc/ssh/sshd_config
Disable password authentication with the following settings:
Allow private public key authentication with the following:
RSAAuthentication yes PubkeyAuthentication yes
Once this is done, restart the SSH daemon to apply the settings.
Additional information can be found here.