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:
- The ED25519 encryption algorithm
- 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're using services like GitHub already, there's a good chance you already have a key like this. All you need is the public key value of your existing SSH key pair. You can likely find this in your ~/.ssh
directory, and look for files ending in *.pub
.
Spin works with any valid SSH key. It does NOT need to be the ED25519 algorithm, just as long as it works with SSH and is secure.
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.