Skip to main content

Step 2: Generating a SSH key

SSH keys are used to safely connect to remote machines, without a password, among other things.

If you already have a SSK key, you can skip to the next step.

We are going to generate a SSH key. (no clue how that works on windows!)

Linux

On Linux, simply type ssh-keygen -t ed25519.
Leave default location (~/.ssh/id_ed25519),.
forFor the password, you can leave it empty if you can guarantee that no one else will ever have access to that file, else set one.
Now that we have a key, we can transfer it to our server. This can be done with ssh-copy-id.
Run: ssh-copy-id <user>@<hostname> and it should just work(TM).

If this didn't work, you can manually add the key yourself.
Print the key in your terminal and copy it: cat ~/.ssh/id_ed25519.pub.
Connect to your server: ssh <user>@<hostname.
Edit the authorized-keys file: nano ~/.ssh/authorized_keys.
Paste what you copied earlier. Save and exit.

Logout of the server and try logging in again. It should not ask for a password.