Step 1: Generate SSH Keys on connecting serveur

# ssh-keygen -t rsa

The -t option specifies what type of key to generate. We've specified a key with the type rsa. It is just a type of key based on the RSA algorithm.

Step 2: Name your SSH keys

The terminal instructs to enter the name of a file in which we want our private key to be saved. You have 2 options:
1- Choose the default filename id_rsa
2- Provide your own unique filename

Two important things to note here:
- If you plan on having multiple SSH keys, it’s best to name each one uniquely.
- If you decide to provide a unique filename, you must type in the complete file path along with the filename

Step 3: Enter a passphrase (optional)

Enter passphrase (empty for no passphrase):

The downside of course is the continuous prompt to enter said passphrase, so adding a passphrase forbids automation of the connexion from script.

Step 4: Move the public key to the remote machine

# ssh-copy-id -i ~/.ssh/ @

Step 5: Test your connection

# ssh @