Q - How to generate a ssh key in linux ?
Q - How to upload SSH key in to OpenStack ?
In this post we will cover how to generate the SSH key and upload in to openstack using command line.
Step 1
Export Environment - Make sure your you exported the openstack environment
. admin_rc
Content of admin_rc file
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_AUTH_URL=http://127.0.0.1:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
Note - Change the password and auth url as per the your openstack configuration
Step 2
SSH Key Generation - Generate the SSH key if you don't have
ssh-keygen
Step 3
Upload Key - Public key will be used to create instance for passwordless authentication.
openstack keypair create --public-key ~/.ssh/id_rsa.pub admin
Step 4 - Validate keypair is available on OpenStack