Configuring SSH with CPanel: A Comprehensive Tutorial

SSH is a network protocol facilitating secure system logins and data exchange. This article outlines steps to configure and deploy SSH keys using cPanel for enhanced security.

Please note that SSH encrypts login details, commands, and text, providing a secure channel for data exchange between devices.

 

Enabling SSH access provides the following advantages:

  • Remote hosting control

  • Capability to add, delete, modify, back up, and restore hosting files and directories.

  • Establishment of a secure connection between two different servers

  • Import and export of your database

 

Steps to Configure SSH Keys in cPanel:

To configure SSH keys in cPanel, you can either create a new key pair or import an existing key. There are two options to enable SSH keys:

  • Generating a new key

  • Importing an existing key

 

Option 1: Generating a New SSH Key

To create a new SSH key for your account, follow these steps:

1. Log in to your cPanel account.

2. Open the SSH Access tool.

SSH Access tool

If you are using the Jupiter theme, navigate to the Tools page, find the Security section, and click on SSH Access. For Paper Lantern theme users, simply click on SSH Access in the security section.

3. Navigate to the SSH Access page and click on Manage SSH Keys.

Manage SSH Keys

4. Next, click on Generate New Key.

Generate New Key

5. Verify the key name, which is set to id_rsa.

6. In the boxes labeled "Key Password" and "Reenter Password," enter the password for the key.

Generate Public Key

Note: You can use the password generator to create a strong password.

7. The key type is configured as RSA.

8. The encryption key has been configured to a size of 2048 bits.

9. Once all the steps are completed, click on "Generate Key."

Generate Key

cPanel generates public and private keys and saves them in the /home/username/.ssh directory, where the username is your account.

10. Click on "Go Back."

11. In the Public Keys section, locate the name of the generated key. Navigate to Actions > Manage.

12. Click on "Authorize," then click "Go Back." Now, to connect your hosting account with the newly generated key, continue reading below.

 

Option 2: Importing an Existing Key

If you've previously generated SSH keys for your account and want to use them, cPanel allows for easy import.

To import existing keys, follow these steps:

1. Log in to cPanel.

2. Navigate to the Security section >> SSH Access.

SSH Access Tool

3. Navigate to the "Manage SSH Keys" section on the SSH Access page, and then select "Manage SSH Keys."

4. Click on "Import Key."

Import Key

5. Enter the desired name for the key in the "Choose a name for this key" text box.

6. Insert the public key into the designated text box that says, "Paste the public key in the text box."

7. Click "Import" to import the key.

8. Navigate back to "Manage Keys."

9. Find the imported key name under "Public keys."

10. In the "Actions" section, click "Manage."

11. Click "Authorize" and then select "Go Back."

 


Was this article helpful?

mood_bad Dislike 0
mood Like 1
visibility Views: 821