Chapter 1
You may already have a SSH key pair.
Lets do a simple check on id_* files.
% ls ~/.ssh/id_*
/home/stappers/.ssh/id_ed25519 /home/stappers/.ssh/id_rsar
/home/stappers/.ssh/id_ed25519.pub /home/stappers/.ssh/id_rsar.pub
/home/stappers/.ssh/id_ed25519r /home/stappers/.ssh/id_rsa_weak
%
It is OK that you have completely different output. So no worries.
Important is that you know if it makes sense to create an identity file also knows as SSH key pair a.k.a. SSH key.
If you have a SSH key, skip the remains of this page.
Creating a SSH key
Pick a new passphrase, a passphrase for the key.
Do
ssh-keygen -t ed25519
Confirm the file path, it is a sane default. Provide the passphrase and once again.
What you might see:
% ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/stappers/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/stappers/.ssh/id_ed25519
Your public key has been saved in /home/stappers/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:u9ZCezgnlaDikEKkNjN4V79epqQ8yQokD9pq8VBADBg stappers@messer
The key's randomart image is:
+--[ED25519 256]--+
|Eo |
|.+ . |
|+ . . . |
|o*... o |
|=.*o .So . |
|oOo . . +.= |
|..Bo + *.O |
| o o. * X.+ |
|o .. o.* |
+----[SHA256]-----+
%