Having SSH key access to your server adds extra door/s of protection, plus instead of needing a password potential hackers now need a key and a password.
Generate you keys using putty key generator. Save the public and private key in safe place with a name you can recognize.
Add key to server
Open PuTTY.exe (or any SSH terminal) and connect to your server with the usual username and password.
Create the ~/.ssh
directory with
mkdir -p ~/.ssh
Then create and open ~/.ssh/authorized_keys
file with
nano ~/.ssh/authorized_keys
Here you want to paste the public key output from PuTTY Gen as seen by this highlighted top part (right click select all and then copy).
Once pasted into ~/.ssh/authorized_keys
do ctrl + x
then y
and enter
to exit and save.
Close the connection
Connect to server with key
Open up PuTTY and put in your servers hostname
On the list at the left find Auth under the SSH sub menu, click it.
Where it says Private key file for authentication click browse and select your private key you just generated. Click session at the top of the list, where is says saved session enter a name (hostname) and click save. To connect simply find the name you just used, click load and then open. It is recommended to disable the normal username password login method after you have finished this key based authentication.