Creating and managing key pairs

SSH key pairs consist of two elements—a public key and a private key. Key pairs are used for access to our Linux hosts via SSH. The public portion of our key pair is injected into our instance at boot-time through a service known as cloud-init. It can perform many tasks, one of which is managing this public key pair injection. Only this specific combination of the public and private key will allow us access to our instances.

Getting ready

To begin with, ensure that you are logged in to your Ubuntu client that has access to the Nova client tools. This can be installed using the following commands:

sudo apt-get update
sudo apt-get install python-novaclient

Ensure you have set the following credentials:

export OS_TENANT_NAME=cookbook ...

Get OpenStack: Building a Cloud Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.