Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Key pairs are SSH credentials which are injected into images when they launch. Creating a new key pair registers the public key and downloads the private key (a .pem file).
SSH key pairs work in two halves; the public key which acts as a lock, and the private key which can be used to open the lock. The public key can be safely passed to your cloud servers while the private key should be kept securely stored on your computer.
Note: Because of design decisions, you can’t share key pairs with users in OpenStack. This raises the problem that key pairs created in the dashboard cannot be used with the OpenStack API credentials. If you want to use the command line interface. Please check out the following tutorial: How to add an SSH key pair that can be used with the CLI
Key pairs are how you log in to your instance after it is launched.
key pairs are how you log in to your instance after it is launched. If you already have a key pair that you generated earlier, you can import and use that key pair.
SSH key pairs can be generated with the ssh-keygen command:
ssh-keygen -t rsa -f cloud.key
This generates a pair of keys: a key you keep private (cloud.key) and a public key (cloud.key.pub). You can import the contents of the public key in the text field at step 4 of Import key pair.
After launching an instance, you log in using the private key (the username might be different depending on the image you launched):
ssh -i cloud.key <username>@<instance_ip>