With the following commands you can set up a public/private key pair authentication for the SSH login of your server:
Generate KEY PAIR
$ ssh-keygen -b 4096
$ (Set a password)
After this command you will get two files named ~/[your keyname].pub and ~/[your keyname]
Now copy the [your keyname].pub file to the subfolder .ssh like this:
CREATE AUTHORIZED_KEYS file
$ cp [your keyname].pub ~/.ssh/authorized_keys
Now copy the [your keyname] - file to your windows pc
Open puttygen.exe and import the [your keyname] - File
Save the private key as [your keyname].ppk
Now your can forbid logins on your server that don't use a private key as following:
forbid logins without private key
$ sudo nano /etc/ssh/sshd_config
$ (In Line 52) New-Value: PasswordAuthentication no
Now you have successfully secured your SSH login. It is only possible to login via SSH with your private key now.
IMPORTANT: Note that if you are running a linux system, which wants to connect to the server, you have to create the public/private key pair on the linux system, not on the target server.