Hosting Prestashop, Magento y WordPress listo para usar, optimizado y con mejoras exclusivas. Soporte especializado, servidores en España
Chat
¿Hablamos?
There was a problem loading the comments.

Generate or import SSH key from cPanel or console

Support Portal  »  Knowledge base  »  Viewing Article

  Print
To manage our SSH keys in cPanel, we must access the SSH Access menu, inside our cPanel, once inside, click on"Manage SSH Keys" where we will have a list of the public and private keys created, as well as several options to add, authorize or delete the keys.

Generate an SSH key in cPanel

To create a new SSH key from cPanel, click on"Generate a New Key":

d972e490672f1a70930e04bdf48ba52d9863d122?t=aa49772098bc2e0be559c1db41edbde8
Once inside, a form will appear that we will have to fill in:

ca62ba2c4ddbf19be5e98ad9247d14bf0d91263c?t=e163fa2c6d047aa13139e61b83eb9f32

Key Name: We can leave it by default to id_rsa, so it will be the key that our account will look for by default every time we try to connect via SSH.
Key Password: The password of the SSH key, it is mandatory if we are generating the SSH key through cPanel. We will have to remember it every time that SSH connections are made with this key.
Key Type
: RSA
Key Size
: 4096

After filling it, we click on Generate Key, itwillshow us a confirmation screen indicating the paths of the keys, as well as the fingerprint.

Authorize or Download SSH key

Authorize public key

In the list of SSH keys we will see two new keys with the name we entered earlier, a public key and a private key.
We may only need one of the two keys, usually the public key, so we must authorize it by clicking on "Manage", highlighted with a blue box below:

b19a45374feca3e059d0b4965a5957b9f57cd661?t=89b99d37c75f5d18cdc335f12a927ab9
. Inside, simply click on "Authorize" to allow connections using that public key.

Download SSH key

To obtain the content of the public key, click on"View/Download", highlighted with an orange box in the image above.
It will allow us to copy the key or download it:

102e5e1b6c4111764d0748b7f7986f557db52e76?t=f370c77615eac8178e95cda504a00d69
For a private key, the process will be exactly the same.

Generate an SSH key from the console

To generate an SSH key from the console we will need access to it.
Once you have connected via SSH to the server, you can generate an SSH key pair using the following commands:

ssh-keygen -t rsa -b 4096 -C "soporte@factoriadigital.com"
Under the -C parameter, we can put something identifying, usually email, to help us identify the purpose or identity of that key.

It will ask for the name of the key, if we leave it empty, it will take the default one: id_rsa, which is already correct.
It will also ask for a password to be able to use the SSH key. If we want to leave it without password, it is also possible, simply pressing Enter and leaving it empty.
Once we finish, the following will appear:

a85ea5dc3c3193a69db6a59e58f2b0313766fdf2?t=a555260ffe9476efd2376ead5d5240ff
Where it will indicate us the path where the public and private key has been generated, as well as the fingerprint.

To visualize the recently created key we will be able to do it from cPanel, as it is observed in the previous point:"Authorize or Download SSH key" or, by means of the command:

cat /home/pruebasfd/.ssh/id_rsa.pub
With the path of the key shown above.

Import an existing SSH key in cPanel

To import an existing SSH key, access the"Import Key" option:

54b843832cda7787ad5654120e40323f8d7ab792?t=c5454e1f121260de6f731636b70ba795
Inside, we will be able to enter our public and/or private key. It is not necessary to enter both if we are not going to use them. It is totally acceptable to enter only the public key, for example.
Therefore, to import a public key into the default key (id_rsa), we will copy the content of the public key into the field"Paste the public key into the following text box":

14a0651ccbeaf3198a4057e99e8a20c338a2fc94?t=7cb421d12a63bfe7e53b046eb5d87242
Done this and after clicking"Import", we will already have our existing SSH key imported.

Si todavía tienes dudas, contacta con nosotros y te ayudamos.


Share via
Did you find this article useful?  

Related Articles


Comments

Add Comment

Replying to  


Self-Hosted Help Desk Software by SupportPal
© FactoriaDigital.com