SSH-Key Based Authentication on a Linux Server
- Generate an SSH Key Pair
Windows/Linux: ssh-keygen
It's recomended to set a password as this will encrypt the Private Key.
- Place the Public Key on the Linux Server
Paste the contents on the Public Key into the authorized_keys file.
sudo nano ${HOME}/.ssh/authorized_keys
- Restart SSH
sudo service sshd restart
Connect via SSH
Terminal: $ sudo ssh -i path-to-private-key username@remote-server-ip
Termius Docs
Putty (Ionos Tutorial)
Disable Password Authentication
sudo nano /etc/ssh/sshd_config
Uncomment PasswordAuthentication yes
Then set value to no PasswordAuthentication no
Restart SSH sudo service sshd restart