Adding SSH Keys in cPanel

Overview:

Creating an SSH Key in cPanel and connecting to your server via SSH is a secure way to access your server and perform command-line tasks. By default, our shared web hosting services do not include shell access as part of their package, however, you can request that this be enabled by contacting our Micron21 Support team directly.

Prerequisites:

  1. Ensure that Shell/SSH access has been enabled for your specific account. You can email our Micron21 Support team and have them enable it on your behalf.

  2. Authorise your local IP address using the FTP/SSH Web Authenticator.  If you're not sure how this is done, you can review our guide here.

Creating and authorising SSH keys:

Create a new SSH key using the cPanel generator, save the key locally and connect using an SSH application.

  1. Log into your cPanel hosting service.

  2. Navigate to the "SSH Access" tool in the "Security" category.

  3. Click the "Manage SSH Keys" button.

  4. In the "Manage SSH Keys" page, click on the "Generate a New Key" button.

  5. Fill in the required information to generate the key.

    1. Key Name: Default is id_rsa.

    2. Key Password: Set a strong password for the key, and save it in a secure place.

    3.  Re-enter Password: Re-type the password you set.

    4. Key Type:  RSA or DSA - if unsure, leave this as the default.

    5. Key Size: We recommend 2048 (or 4096 where possible).

  6. Click "Generate key",  this will generate the public and private key combination and save it to the following path:
    Your identification will be saved in /home/USER/.ssh/KEYNAME.
    Your public key will be saved in /home/USER/.ssh/KEYNAME.pub.

  7. Authorise your key by clicking "Go Back" or navigating to the "Manage SSH Keys" page again.

  8. Under "public Keys" click manage on the new key you created then click "Authorize".

  9. Navigate to the file using the "File Manager" tool in cPanel, you will need to show hidden files as the directory is a dotfile.

  10. Download the private Key and save it in a secure location on your local machine. (Right-click the file and select download).


Connecting to the server by SSH: 

  1. Open your SSH connection application, such as puTTY or Windows Terminal, on your local computer.

    1. The default for windows devices: Command Prompt.

    2. The default for Mac: Devices Terminal.

  2. Type the command ssh username@yourdomain.com -i /path/to/privatekey and press enter.

    1. The username will be your primary cPanel username.

  3. If prompted, enter the passphrase for the private key.

  4. You should now be connected to the server via SSH and can perform command-line tasks.


Can't find what you're looking for?

Create or manage support tickets directly with Micron21

You will need to register a new account if this is the first time lodging a ticket.

If you have previous lodged a ticket either online, email or over the phone you will already have an account. Please reset your password, if you have not logged into the support portal before.

Lodge a ticket Manage existing tickets

Need to send us information securely? Use our Escrow service here

Need more advanced support?

Micron21 provides a comprehensive approach to customer care that starts with a base 24/7 support that is included free with every service we offer - there are no charges to enjoy a basic level of support with Micron21 and you are not restricted in how you contact us to receive assistance any time of day or night.

For those who require more advanced support though, our Customer Care plans and Ad-Hoc support are designed to completely remove the complexity of IT management - from taking full responsibility for your entire infrastructure or tailoring a custom approach, we have the capability and know-how.

 

If you've organised remote assistance from Micron21, click here to connect

Sign up for the Micron21 Newsletter