In addition to password authentication, our IaaS Cloud supports SSH Key Pairs as a secure method for accessing virtual machines remotely. Each key pair consists of a public key stored on the cloud server and a private key kept on the user's local machine. When connecting to the virtual machine, the server authenticates the user by matching the provided public key with the corresponding private key. This method ensures secure access without the need to transmit sensitive information like passwords over the network, thereby enhancing overall security in cloud-based environments. Additionally, it adds ease of use because a single key pair can manage multiple instances.
To create a SSH key pair for your instances, follow these steps:
1. Navigate to Compute → SSH key pairs on the left navigation bar.
2. Click on Create SSH Key Pair button in the top row:
3. In order to complete the creation process, you need to provide some additional parameters:
If a public key is set, our IaaS Cloud will register the public key, allowing you to use it with your private key. If a public key is not set, our IaaS Cloud will create a new SSH key pair. In this case, please copy and save the private key, as our IaaS Cloud will not retain it.
4. Optionally, you can assign the key pair to a specific Domain and Account.
5. Click on OK to save an create the SSH key pair.
6. If you didn't specify any public key during the process, please Copy or Download your private key from the popup window and store it accordingly.
If your instance has not yet been created, you can assign the SSH key pair during the deployment process by following our guide on Creating Instance. However, if the instance is already created, you can still assign the SSH key pair by following a few simple steps to set it up correctly and ensure successful login:
1. Navigate to Compute → Instance on the left navigation bar.
2. Select the instance from the list view to which you want to assign the key pair.
3. Click on Reset SSH key pair in the right top action toolbar:
Note that the instance must be stopped in order to access the SSH key pair option.
4. Select a specify SSH key pair that you would like to add to this VM.
5. Click on OK and Start instance again.
6. Once your instance is started and running, assuming all other conditions are fulfilled such as storing your private key appropriately on your local machine and configuring the network of your instance with open ports, you should be able to connect to your machine using:
ssh -i ~/.ssh/your_private_key root@your_instance_ip
If you're attempting to connect to your instance from a Windows machine, there are a few additional steps to consider. To successfully establish a connection using SSH key pairs, please refer to our SSH key pair tutorial for detailed instructions.
To manage and reset your SSH key pairs, follow these steps:
1. Navigate to Compute → Instance on the left navigation bar.
2. Select the instance from the list view to which you want to reset the key pair.
3. Click on Reset SSH key pair in the right top action toolbar:
Note that the instance must be stopped in order to access the SSH key pair option.
4. Select a new key pair or add an additional key pair to those already in use.
5. Click on OK and Start instance again and you're ready to go.
To delete an SSH key pair, follow these steps:
1. Navigate to Compute → SSH key pairs on the left navigation bar.
2. Mark one or more key pairs from the list view.
3. Click on the Remove SSH Key pair button in the top row:
4. Click on OK and the operation window will provide you with information and the status of the key removal process.