Chapter 0

Have this:

  • Curousity about ssh
  • Computer / laptop
  • SSH client software
  • command line interface

Check with ssh -V, see something like

$ ssh -V
OpenSSH_9.2p1 Debian-2+deb12u5, OpenSSL 3.0.15 3 Sep 2024
stappers@messer:/usr/src/rust/ssh_workshop_kit/course/src
$

Rumours say that even works on Microsoft Windows.

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]-----+
%