Keypair
About Keypairs
In OpenStack, keypairs are user-scoped, meaning they belong to the user who created them and can be used across multiple projects. This allows flexibility but also requires careful management to ensure security and avoid unintended access. Important:
info
Keypairs are not project-specific; they are tied to your user account. For production environments, limit the use of shared keypairs and ensure each user or service has its own keypair. Regularly audit and remove unused keypairs to minimize security risks.
Create keypair
openstack keypair create mykey > mykey.pem
chmod 600 mykey.pem
Show Keypair
openstack keypair list
+-------+-------------------------------------------------+------+
| Name | Fingerprint | Type |
+-------+-------------------------------------------------+------+
| mykey | b6:e0:3f:f3:c3:63:92:00:ec:0f:75:34:f6:8f:55:c2 | ssh |
+-------+-------------------------------------------------+------+
Using a keypair in a vm
openstack server create \
--image jammy \
--flavor cpu1-ram2-disk16 \
--network network-test \
--key-name mykey \
vm-test
ssh -i mykey.pem [email protected]