In the following tutorial we will explain how to create SSH keys locally from Windows so that you can use them on your Clouding cloud servers. Note that once created you will need to import your SSH keys to your Clouding client panel.
Create SSH key in Windows
Para crear tus llaves SSH en Windows te vamos a explicar dos formas de generarlas: utilizando SSH-KeyGen y el cliente de SSH PuTTY y PuTTY-Gen.
With SSH-KeyGen
SSH-KeyGen is a standard component of the Secure Shell (SSH) protocol packages found on Unix and Microsoft Windows computer systems. These protocols are used to establish secure shell sessions between remote computers over insecure networks by using various cryptographic techniques. In particular, the ssh-keygen utility is used to generate, manage and convert authentication keys for access using these protocols.
Install OpenSSH Client feature on Windows
In case you are using a Windows computer you need to have the feature, you can run the following in a PowerShell with administrator privileges to install it:
# Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
You can also do it from the "Add optional features" itself.
Creating keys
To generate the keys for SSH access you must run:
# ssh-keygen
By default, it uses RSA 3072 bits. To generate keys with higher encryption (e.g. RSA 4096 bits) you can run:
# ssh-keygen -t rsa -b 4096
Once the command is executed, the utility will first prompt for a directory to store the keys. You can leave it empty by directly pressing Enter to use the default path:
Generating public/private rsa key pair.
Enter file in which to save the key (/user/.ssh/id_rsa):
Subsequently, it will indicate the possibility of adding a passphrase for the use of the key (optional):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
You can leave it empty if you want to dispense with entering it when using the key for the connection. Once these actions have been performed, the SSH keys will have been created and you should see an output similar to the following:
Your identification has been saved in /user/.ssh/id_rsa
Your public key has been saved in /user/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:7dRQDxLJcKXoZAVByMHQ0aR5AG2O8qgu7BT83kRgvVc user@equipo
The key's randomart image is:
+---[RSA 3072]----+
| oB+B*==++ |
| . B+.+o+ o |
| o =o =Eo . |
|. o o o=.. o |
| o + o .S o . |
| + o . o |
|.o . . . |
|+.. o |
|+o . . |
+----[SHA256]-----+
Important
Remember that once you have created the SSH key you can upload the private or public key in your Clouding client panel. If you don't know how to do it, we leave you this tutorial that explains how to use your SSH keys in Clouding. If your server is already created and you only want to transfer the public key to be able to connect, you can do it by following the same tutorial where we explain how to transfer SSH key to the server.
With PuTTy Key Generator
In order to generate the SSH key from Putty, you must first download Puttygen for 64bits, which is used to generate the keys.
Once you have downloaded it, you will have to run it and this window will open:
In order to generate the SSH key, you must click on the Generate button:
Then move the mouse cursor to generate the key and fill the loading bar:
After finishing the process, you will have the SSH key created:
Once you get to this screen, you can save the private key and the public key by clicking on the corresponding Save Public Key and Save Private Key buttons.
Once you have these files, you can import them to the Clouding panel to be able to use them with your cloud servers. If you want to know how to do this check out our article How to access your cloud servers in Clouding.
Connecting to the server using SSH keys
In order to connect via SSH from Windows using PuTTY, you must first configure PuTTY to be able to do so. Open the SSH Client and go to Connection > SSH > Auth.
In this section click on the Browse... button to select the Private Key you have previously generated with PuTTY-Gen. button to select the Private Key you have previously generated with PuTTY-Gen.
Then go to Session in the sidebar, and configure access as follows:
You must configure the Host Name (or IP address) with the public IP of the Clouding server and the SSH Port. Then select in Connection type the SSH option and in Saved Session add a name to the session and click Save. This way you will be able to load it in the future.
After that, you can click on the Open button and the window with the access to the server using the SSH key will open.
We hope we have solved your doubts with this tutorial. Do you have more questions? Write us at support@clouding.io We are here to help you! 😉