Skip to content

Keypairs (SSH keys) Management

A keypair is basically a ssh key allowing you to login to your Linux instance

Info

Keypairs have to be created before instances creation, and associated during the instance creation process.

Using your existing SSH key

KeyPair List

Assuming your existing ssh public key is located at ~/.ssh/id_rsa.pub

Import it using the following command:

user@client:~$ openstack keypair create --public-key ~/.ssh/id_rsa.pub user_keypair
+-------------+-------------------------------------------------+
|    Field    |                      Value                      |
+-------------+-------------------------------------------------+
| fingerprint | 92:d6:30:*********************:f4:a7:9d:d3:2f   |
| name        | user_keypair                                    |
| type        | ssh                                             |
| user_id     | f3e****************************5953b            |
+-------------+-------------------------------------------------+

$ ssh -i ~/.ssh/id_rsa cloud-user@test-instance

Key Pair Actions

Create Key Pair

To create a new key pair, follow these steps:

  1. Navigate to the "Keypairs" section.
  2. Click on the "Create Keypair" button.
  3. Provide a name for your keypair.
  4. Provide a "Key Type" or your keypair. "SSH Key" or "X509 Certificate"
  5. Click on the "Create Keypair" button.
  6. Copy Private Key to the Clipboard and make sure to keep it safe
$ openstack keypair create --public-key <path-to-public-key> <keypair-name>

Import Key Pair

To import a public key, use the following steps:

  1. Navigate to the "Keypairs" section.
  2. Click on the "Import Key Pair" button.
  3. Provide a name for your keypair.
  4. Paste your public key into the designated field.
  5. Click on the "Import Key Pair" button.
$ openstack keypair create --public-key <path-to-public-key> <keypair-name>

Delete Key Pair

To delete a key pair, follow these steps:

  1. Navigate to the "Keypairs" section.
  2. Select the key pair you want to delete.
  3. Click on the "Delete Keypair" button.
  4. Confirm the deletion.
    $ openstack keypair delete <keypair-name>