SSH keys
In this article:
SSH keys#
General information#
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.
Billing#
SSH keys are free of charge.
Available quotas#
The following default quota is allocated to SSH keys:
10 SSH keys in a project.
If necessary, you can increase quotas. To do this, contact the support service via the support portal or by email support@k2.cloud.
Create a key#
In the top menu of the web interface, select the project and region where you want to create an SSH key.
Expand the side menu by clicking .
Go to Virtual machines Compute SSH keys. To quickly find the section, you can use the menu search.
Click Create.
In the window that opens, select the required tab — create a key or upload your own one.
Enter key name. The name may contain only Latin letter and numbers.
(For the Import key tab only) In the Public key field, paste the content of your public key (for example, from the file
~/.ssh/id_rsa.pub).
If you need to set a tag, click Add tag and specify the tag key and value. To assign more tags, click Add tag again.
After setting all the required parameters, click Create.
If the Create key tab is selected, the cloud will generate an SSH key and save its public part only. If the Import key tab is selected, the cloud will save the uploaded public key.
Important
When creating a new key pair, the private key will be downloaded by your browser. Keep it safe.
Modifying the key#
In the top menu of the web interface, select the project and region where you want to change the SSH key for an instance.
Expand the side menu by clicking .
Go to Virtual machines Compute Instances. To quickly find the section, you can use the menu search.
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:
click to edit;
select the new SSH key from the drop-down list.
Click to save the changes.
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#
Setup of tags for SSH keys is not available in the new web interface yet. Please use the previous version of the web interface.
Deleting a key#
In the top menu of the web interface, select the project and region where you want to delete an SSH key.
Expand the side menu by clicking .
Go to Virtual machines Compute SSH keys. To quickly find the section, you can use the menu search.
Select the key in the resource table.
Click Delete.
In the dialog window, confirm the action.
To recover the deleted SSH keys, upload them again.
Important
When deleting a key pair in the K2 Cloud, you delete only the public key stored in the cloud.
Instances, to which a public key was added, can still be accessed via SSH. To prohibit any access using a particular SSH key, delete the respective public key from all the instances to which it was added.
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.