SSH keys
In this article:
SSH keys#
K2 Cloud supports SSH-key authentication. This method provides a higher level of security and, in many situations, is more convenient for accessing instances than traditional password entry.
The cloud stores the public key and allows users to store the private key on the local computer. You can also create your own key pair using any key generation tool and upload the public key to the cloud.
Note
K2 Cloud uses 2048-bit RSA keys.
Create a key#
To create a new pair of SSH keys or upload your own public key:
Go to the Virtual machines Compute SSH keys and click Create.
In the window that opens, enter a key name and choose the required option: either generate a new key or upload your own one. The SSH key name should contain only Latin letters and numbers.
Important
When creating a new key pair, the private key will be downloaded by your browser. Keep it safe.
If you need to assign tags, proceed to the next step by clicking Add tags. Enter the tag key and value.
After setting all the required parameters, click Create.
Modifying the key#
To assign a new SSH key to an instance:
Go to the Virtual machines section Compute Instances.
Find the instance in the resource table and click the instance ID to go to its page.
In the Information tab, edit the SSH key field.
Confirm the action.
Important
This operation adds a new key each time a key is changed but old key is not removed. Reboot an instance for changes to take effect.
Assigning tags#
To add, modify or delete SSH key tags:
Go to Virtual machines section Compute SSH key.
In the resource table, select the SSH key for which tags should be edited and click Customize tags.
To add a tag, click Add tag and specify the Key and Value fields.
To modify a tag, edit the required fields (Value and/or Key) of the respective tag.
To delete a tag, click the icon next to the tag you no longer need.
Note
If no tags have been set earlier, you can add the Name tag by clicking Add Name tag and specifying its value.
Click Apply to save the changes.
Deleting a key#
To delete public SSH key:
Go to Virtual machines section Compute SSH key.
Select the key in the resource table.
Click Delete.
Confirm deletion.
Deleted SSH keys cannot be restored.
Important
When deleting a key pair in the K2 Cloud, you delete only the public key.
You cannot start a new instance using a deleted key pair, but you can still connect to the instances you started using the deleted SSH key pair.
Information about a key#
General information about available SSH key pairs can be viewed in the resource table in Virtual machines Compute SSH keys. The table lists all SSH key pairs and their parameters: ID, name, and fingerprint. The sequence and scope of the displayed data may vary depending on the table settings.