In the following tutorial we will explain how to create SSH keys locally from GNU/Linux so that you can use them on your Clouding cloud servers. Note that once created you will have to import your SSH keys to your Clouding client panel.
Create SSH key on GNU/Linux
To create/generate the keys for SSH access you must run:
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 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]-----+
Remember that once you have the SSH key created you can upload the private or public key in your Clouding client panel. If you don't know how to do it, here is a tutorial that explains how to do it 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 this tutorial on how to transfer SSH key to the server.
Connecting to the server using SSH keys
From any GNU/Linux, you can open a Terminal and connect easily following these steps. The first thing to do is to correctly configure the permissions of the private key (id_rsa.pub).
# chmod 600 llave_ssh.pem
And to connect use this command:
# ssh [usuario]@[IP_pública_del_Servidor] -i llave_ssh.pem
If you have any questions about SHH keys in Clouding or any other question related to your cloud servers, please contact us at firstname.lastname@example.org We are here to help you! 😉