- How to Configure SSH Using cPanel?
- Enabling SSH access permits for:
- How to Set Up SSH Keys in cPanel
- Option 1: Generate a New SSH Key
- Option 2: Importing an Existing Key
- How to Log Into Your Account with SSH Keys?
- How to Configure SSH Using cPanel: Windows Operating System
- A Guide to Using PuTTY: How to Configure SSH Using cPanel
- Utilizing the Built-In SSH Client on Windows
- Enabling SSH access permits for:
How to Configure SSH Using cPanel? #
How to Configure SSH Using cPanel, SSH is a network protocol that enables secure system login through a secure channel. It allows for the safe exchange of data between two devices by encrypting login details, commands, and texts.
You can set up an SSH key on your cPanel. This article provides steps to configure and deploy SSH keys using cPanel.
Enabling SSH access permits for: #
- Remote hosting management
- Manage hosting files and directories: add, remove, edit, backup, and restore
- Establish a connection between two separate servers
- Import and export databases
How to Set Up SSH Keys in cPanel #
To set up SSH keys in cPanel, you can either generate a new key pair or import an existing one.
Here are the options to enable SSH keys:
- Generate a new key
- Import an existing key
Option 1: Generate a New SSH Key #
To generate a new SSH key for your account, follow these steps:
1. Log in to your cPanel account.
2. Open the SSH Access tool:
- If you’re using the Jupiter theme, navigate to the Tools page, and in the Security section, click on SSH Access.
- If you’re using the Paper Lantern theme, click on SSH Access in the security section.
3. On the SSH Access page, click on Manage SSH Keys.
4. Select Generate New Key.
5. Confirm the key name as id_rsa.
6. Enter and reenter the key password in the respective fields.
Note: You can use the password generator to create a strong password.
7. Set the key type to RSA.
8. Set the key size to 2048.
9. Click on Generate Key after completing all the steps.
cPanel will generate public and private keys and save them in the /home/username/.ssh directory, where the username is your Trustify Hosting account.
10. Click on Go Back.
11. In the Public Keys section, find the name of the key you generated. Go to Actions > Manage.
12. Click on Authorize, then Go Back. To connect your hosting account with the newly generated key, continue reading below.
Option 2: Importing an Existing Key #
If you’ve created SSH keys for your account and need to store them, you can import them using cPanel.
Follow these steps:
1. Log in to cPanel.
2. Navigate to the Security section >> SSH Access
3. On the SSH Access page, under Manage SSH Keys, click Manage SSH Keys.
4. Click Import Key.
5. In the “Choose a name for this key (defaults to id_dsa)” text box, enter a name for the key.
6. Paste the public key text into the provided text box.
7. Click Import. cPanel will import the key.
8. Click Back to Manage Keys.
9. Find the imported key name under Public Keys.
10. In the Actions section >> Manage.
11. Click Authorize and then Go Back.
How to Log Into Your Account with SSH Keys? #
Follow the appropriate steps for your computer’s operating system.
How to Configure SSH Using cPanel: Windows Operating System #
If your computer uses Microsoft Windows, you can utilize the PuTTY program to connect your account with SSH keys. Alternatively, Windows 10 offers a built-in SSH client, so there’s no need to install and set up an extra program.
A Guide to Using PuTTY: How to Configure SSH Using cPanel #
Before connecting to your computer, you must deploy the private key to your local machine. Follow these steps:
- Log in to your cPanel account.
- Go to the SSH Access tool under the security section.
- On the SSH Access page, under Manage SSH keys, click on Manage SSH keys.
- Under Private Keys, find your key name and click View/Download.
- Click on Convert to convert the “id_rsa” key to PPK format. cPanel will handle the conversion.
- Click Download key and save the id_rsa.ppk file on your local computer. You are now ready to configure the PuTTY client to connect to your SSH account using the private key.
Configuring PuTTY #
To use your private key, follow these steps:
- Start PuTTY.
- In the Category section, expand SSH and click on Auth.
- Under Authentication Parameters, click Browse.
- Locate the id_rsa.ppk file created earlier.
- In the Category section, click on Session.
- In the Host Name textbox, enter username@xyz.com (replace “username” with your hosting account and “xyz.com” with your domain name).
- Enter 7822 in the Port textbox.
- Ensure the Connection type is set to SSH.
- In the Saved Sessions textbox, enter a name for the connection.
- Click Save.
- To connect to your SSH account, double-click the connection name in the list.
- PuTTY should connect without requesting a password.
And that’s how you can configure SSH using cPanel in different ways.
Utilizing the Built-In SSH Client on Windows #
To use the Windows SSH client with your hosting account using a key, follow these steps:
- First, log in to cPanel.
- Open the SSH Access tool.
- On the SSH Access page, click Manage SSH Keys.
- In the Private Keys section, find your key’s name and click View/Download.
- Click Download Key and save the id_rsa file to your local computer. Make sure to note where you save it. To make it the default key for SSH connections, save it in the \Users\username\.ssh directory, where username is your Windows username.
- Open the Run dialog box by pressing Windows key + r.
- In the Run dialog box, type cmd and click OK to open the command prompt.
- At the command prompt, type the command below, replacing username with your hosting account username and xyz.com with your domain name.
ssh -portusername@xyz.com
9. If you did not save the key file in the \Username\.ssh directory in step 5, specify the key file location.
To do this, replace path with the directory path where the file is saved:
ssh -port-i path username@xyz.com
If you’re connecting to the server for the first time, you’ll see a message about the key fingerprint. Just type “Yes” and press “Enter”.
Once connected, the remote server’s command line prompt will appear:
username@hostname [~]#
10. You can now run commands on the remote server. To list the current directories, type ls and press Enter.
11. To close the SSH connection, type exit and press “Enter”.
Conclusion
This guide has shown the various ways to configure SSH using cPanel.