Keypairs
Keypairs serve several critical functions in colossus cloud environment:
Security
- Provide secure SSH access to instances
- Replace less secure password authentication
- Enable encrypted connections between user and instances
Authentication
- Act as your digital credentials for instance access
- Allow automated scripts and tools to securely connect
- Prevent unauthorized access to your cloud resources
Management Benefits
-
Instance Access
- Required for initial instance setup
- Enable remote administration
- Allow secure file transfers
-
Automation
- Enable infrastructure as code
- Support automated deployment scripts
- Facilitate CI/CD pipelines
Best Practices
- Keep private keys secure and never share them
- Use unique keypairs for different projects
- Back up private keys safely
- Name keys descriptively
To create a keypair with the CLI:
openstack keypair create <keypair-name> > <keypair-name>.pem
chmod 400 my-key.pem
You can also create a keypair with your own local ssh public key:
openstack keypair list
openstack keypair create --public-key <public-key-name>.pub <keypair-name>
Then you can exter your instance by using your ssh key, for example in a ubuntu
instace:
ssh -i ~/.ssh/my_ssh_key ubuntu@INSTANCE_IP
Without a valid keypair, you cannot access your instances, making them a fundamental component of colossus infrastructure.
Create SSH key for Colossus
You can also create your public/private ssh keys and upload the public key to Colossus to create the keypair, the steps are:
Step 1: Create the SSH keys
Launch the ssh-keygen
command and leave empty the passphrase.
ssh-keygen -t ed25519 -C "user-email@domain.com"
[openstack@DESKTOP-G16DBTQ]:/mnt/c/Users/openstack/Desktop $ ssh-keygen -t ed25519 -C "user-email@domain.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/openstack/.ssh/id_ed25519): /home/openstack/.ssh/id_openstack_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/openstack/.ssh/id_openstack_key
Your public key has been saved in /home/openstack/.ssh/id_openstack_key.pub
The key fingerprint is:
SHA256:ErPuaD4XKwOXgfaY5s user-email@domain.com
The key's randomart image is:
+--[ED25519 256]--+
|**o ..... . |
|+oo. . . . |
|...o o . o |
| o... + . + |
|..+oo.o S . + |
|o.*=o... E |
|*o.+ .o |
|*. =oo |
|+o oo=. |
+----[SHA256]-----+
Step 2: Upload the publilc key
Inside colossus web interface in Compute
-> Key pairs
, create a new one by pressing Import Public Key
, fill the name fiel, select SSH key
in Key Type
selection and choose the .pub
file just created in step 1, then press Import Public Key
button: