Introduction
This document describes how to get the cliqr-user-keys.pem file and use it in order to access the deployed Virtual Machine (VM) if no custom keys were provided at the time of the deployment.
How to get Cliqr-user Keys in order to access deployed VM?
By default, when a user deploys the application without providing the custom keys, it uses its owner's keys in order to deploy the instance.
To get the cliqr-user keys, follow these steps:
1. Login to the CCM GUI and deploy the application with No Preference as shown in the image.
2. The keys can be retrieved with the use of an API key, in this case, curl command is used in order to retrieve users key from which Cliqr deploys the instance.
curl -k -X GET -H "Accept: application/json" -u cliqradmin:395C1C3A7ACF1OD7 "https://<CCM IP>/v1/users/2/keys"
Output:
{"apiKey":{"key":"395C1C3A7ACF1OD7"},"sshKeys":[{"key":"-----BEGIN RSA PRIVATE KEY-----\nIv5rX89S7a14MzD3LEAKVWYWmRUxHdMT\n0NjAV6zDCztBgclCM+fYzP89rTTIBN29Rzb9c9H9ZtOWOP1
/f4y+mF0dzqJgHkGT\nAQKlQ6tX8Ygwu/corazC3gvBozl32RvFR/6hreFpKUDsoqsuo6hXJTua/xyaotmq\nvPJoqpXwGZKsSMVYHFN2USo2gG21fR7bwHChA6DJY5LsmUKngQoTmWdU7x/F2AMl\n9xSudL0vNVZ+fMuB4k3
rIAupH6LFArOt+tpl+QIDAQABAoIBAHLRIri6foJERj8e\nB1ljNrPgPwBKcnJ2Cwwf498ivp0dz561FRT3uYdaVqUJWf5X251BslnXo02FBpZO\ndG2XedaYRx9tBHaPvfm1D742tyxe+gWv19KpOYaApE7CciVdRyG3OrDbM
diH9cJz\n1s45GQPOs+oXcNGqCofHhsD8frqXt/qTPOKP78hgx3bomk7N4v/2kRWOv6JfB4/W\ntS8DlB9Ngtq+==\n-----END RSA PRIVATE KEY-----\n","cloudAccountId":"1","cloudAccountName":"12345678908","cloudRegionId":"1","cloud":"Vihar_AWS_HA-us-east-2"}],
3. Once you get the output, copy the private key to a file.
echo -e "insert keys here" > key.pem && chmod 0400 key.pem
Note: You need to copy the key that start from ---BEGIN RSA to ---END RSA Keys----\n. This is the Secure Shell (SSH) option. If custom OS is provided in order to deploy, the user might change in accordance to the cloud-init.
4. SSH to the instance that it uses the key.pem file.
ssh -i user2.pem cliqruser@IP ADDR