How to setup a RSA key in your Linux server

First, generate the key :

– Download PuTTYgen.

– You can select the encryption (1024 bits, 2048 or 4096 bits).

– Launch the program, click generate. You have to move the mouse on the gray surface.

– Save the public key (id_rsa.pub).

– Enter a key passphrase. You will have to enter it each time (like a password). It will protect the use of the private key.

– Save the private key (privatekey.ppk).

Copy the public key in your server :

nano ~/.ssh/authorized_keys

On PuTTYgen, copy the public key (starting with ssh-rsa), and paste it into your server authorized_keys.

Save.

Change the permissions :

chmod 600 ~/.ssh/authorized_keys

In PuTTY, go to the SSH > Auth :

Browse the private key.

Save the session in the main tab.

Nexs steps :

Disable the password access with root login for SSH.
Use FileZilla and RSA key.