To add a key
You can generate a keypair or upload an existing public key.
To generate a keypair, run the following command:
$ nova keypair-add
KEY_NAME
>MY_KEY
.pemThe command generates a keypair named
KEY_NAME
, writes the private key to the
file, and registers the public key at the Nova database.MY_KEY
.pemTo set the permissions of the
file, run the following command:MY_KEY
.pem$ chmod 600
MY_KEY
.pemThe command changes the permissions of the
file so that only you can read and write to it.MY_KEY
.pem
To import a key
If you have already generated a keypair with the public key located at
~/.ssh/id_rsa.pub
, run the following command to upload the public key:$ nova keypair-add --pub_key ~/.ssh/id_rsa.pub
KEY_NAME
The command registers the public key at the Nova database and names the keypair
.KEY_NAME
List keypairs to make sure that the uploaded keypair appears in the list:
$ nova keypair-list