Generate a key pair

Introduction

Most cloud images support public key authentication rather than conventional password authentication. Before launching an instance, you must add a public key to the Compute service.

If you have generated a key pair with an external tool, you can import it into OpenStack. The key pair can be used for multiple instances that belong to a project.


Add a key pair

Create at least one key pair for each project.

  1. Log in to the dashboard.

  2. Select the appropriate project from the drop down menu at the top left.

  3. On the Project tab, open the Compute tab.

  4. Click the Key Pairs tab, which shows the key pairs that are available for this project.

  5. Click Create Key Pair.

  6. In the Create Key Pair dialog box, enter a name for your key pair, and click Create Key Pair.

  7. The private key will be downloaded automatically.

  8. To change its permissions so that only you can read and write to the file, run the following command:

shell $ chmod 0600 yourPrivateKey.pem

Import a key pair

  1. Log in to the dashboard.
  2. Select the appropriate project from the drop down menu at the top left.
  3. On the Project tab, open the Compute tab.
  4. Click the Key Pairs tab, which shows the key pairs that are available for this project.
  5. Click Import Key Pair.
  6. In the Import Key Pair dialog box, enter the name of your key pair, copy the public key into the Public Key box ( or download the public key file), and then click Import Key Pair.

The Compute database registers the public key of the key pair.

The Dashboard lists the key pair on the Key Pairs tab.