Managing key pairs

This key pair will allow you to connect through SSH to the instantiated VMs.

Generate a key pair

% ssh-keygen -t rsa -f ~/.novacreds/cloudkey
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in ~/.novacreds/cloudkey.
Your public key has been saved in ~/.novacreds/cloudkey.pub.
The key fingerprint is:
a6:19:d0:03:b0:44:80:84:e9:df:17:3b:3a:23:bb:d0 nobody@nogroup
The key's randomart image is:
+--[ RSA 2048]----+
|==+..            |
|+. . o           |
|. . . o          |
| .   . o         |
|  . . . S        |
|  .. . O         |
| . E  = .        |
|  .. +           |
|   o+ o          |
+-----------------+

Provide the public key to Openstack

% openstack keypair create --pubic-key $HOME/.novacreds/cloudkey.pub cloudkey

List the key pairs

% openstack keypair list
+----------+-------------------------------------------------+
|   Name   |                   Fingerprint                   |
+----------+-------------------------------------------------+
| cloudkey | 01:4a:cb:05:ff:6a:67:6e:c6:50:e8:a0:eb:ef:e7:95 |
+----------+-------------------------------------------------+

Check the correspondence between a local and a published key

To verify that the fingerprint displayed by the previous command matches that of a local public key:

% ssh-keygen -l -f /chemin/vers/la/cle/publique/locale.pub

Use a key pair

% openstack server create --key-name cloudkey --image SL6.2-x86_64 --flavor m1.tiny mavm
[...]

Do more

% openstack help keypair
    keypair create      Create a new key pair for use with instances
    keypair delete      Delete keypair by its id
    keypair list        Print a list of keypairs for a user
    keypair show        Display key details