While SSH supports password authentication, disabling password authentication in favor of using SSH keys is considered to be more secure, as SSH keys are not vulnerable to common brute-force password hacking attacks.
An SSH key pair consists of two parts - a public key and a private key. The public key lives on the server and grants access to SSH clients that possess the associated private key.
SSH keys can be created for individual cPanel users or for the root user. Here we cover the steps to create and download an SSH key for root access on your VPS or Dedicated Server.
Related Articles
Log into Root WHM Using AMP
How to SSH into VPS or Dedicated Servers
Root SSH Keys
- Log into Root WHM
- Navigate to Security Center -> Manage root's SSH Keys
- Click on Generate a New Key
- Fill in the details for the new key
- The Key Name field may remain blank unless you'd like to give it a name other than the default id_rsa
- Enter a strong password in the Password field or use the Password Generator button to create a random password, then enter the same password in the Password (Again) field
NOTE: Password is optional but recommended for increased security. This password will be used when connecting to the server using the SSH key. - RSA is the recommended option for Key Type
- Key Size should be 2048 or 4096; 1024 is not recommended
NOTE: Larger key sizes are more secure, but they result in larger file sizes and slower authentication times.
- Click the Generate Key button
- Once the key is generated, click Return to SSH Manager
- Click Manage Authorization to the right of the public key you created
- Click the Authorize button
- Click Return to SSH Manager, then click View/Download Key to the right of the Private Key
- Copy the key from the text box into a text file and save to your computer
NOTE: If using PuTTY, type in the ssh key's password into the passphrase box to convert the private key into putty's PPK format.
TIP: The exact method of utilizing the key will vary by operating system and terminal application, but the command to connect using the SSH key would generally be as follows, replacing "/path/to/key_file_name" with the file path to the private key file you created and "server" with your server's hostname or IP address:
ssh -i /path/to/key_file_name root@server
Comments
0 comments
Please sign in to leave a comment.