Generating a Secure SSH Key

Having a secure SSH key is super important. This allows us to authenticate to our servers using keys instead of insecure methods such as passwords.

A few things about that will make this key secure:

  1. The ED25519 encryption algorithm
  2. A password protected key (if you password protect your key, you may need to go through additional steps to configure your SSH agent)

If you want to nerd out on why we suggest this algorithm, you can read this guide.

👨‍💻 Generating an SSH key

If you need to create an SSH key, you can run this on your local machine:

Generate an SSH key

ssh-keygen -o -a 100 -t ed25519

It will create two files:

Files created

~/.ssh/id_ed25519 # ❌ This is your PRIVATE key. Keep this secret
~/.ssh/id_ed25519.pub # ✅ This is your PUBLIC key. This is the value we want to use

To get the public key value, you can run this command:

Get the public key value

cat ~/.ssh/id_ed25519.pub

This will echo the public key value to your terminal.

What to do with this key

You can copy this value and use it in your .spin.yml when you configure your "users.username.authorized_ssh_keys" for your server.