How to Configure SSH Using cPanel?
SSH (Secure Shell) is a cryptographic network protocol which was created to securely access and manage computers over unsecured networks. It provides a secure channel between a client and a server that allows users to log in remotely, transfer files, execute commands and manage infrastructure with strong encryption and authentication mechanisms.
This blog explains how to configure SSH keys using cPanel.
Steps to Configure SSH Keys in cPanel
To configure SSH keys in cPanel, you have to create a key pair or import the existing key. There are different options to enable the SSH keys:
- Generating a new key
- Importing an existing key
How to Generate a New SSH Key in cPanel
To generate a new SSH key pair directly from your cPanel interface. Follow the steps below:
1. Log in to cPanel
Login to your cPanel account using your credentials.
2. Navigate to SSH Access
Go the SECURITY section and choose SSH Access
3. Manage SSH Keys
Select Manage SSH Keys button
4. Generate a New Key
Select Generate a New Key
- Use the default (id_rsa) or add a custom name.
- Enter a strong password or use the password generator for entra security. Save this password securely.
- Choose RSA or DSA if required.
- Select 2048 or 4096 bits (4096 is more secure).
Once all the details are added, select Generate Key.
5. Authorize the SSH Key
After the key is generated, you need to authorize it:
- Go back to the SSH Keys list.
- In the Public Keys, click Manage next to the key you just created.
- Click Authorize to enable the key for SSH access.
6. Download the Private Key
To use the SSH key from your local computer:
- In the SSH Access section, click View/Download next to your key pair.
- Download the private key file and save it in a secure location on your computer.
- If you are using Windows and need to use PuTTY, you may need to convert the key to .ppk format using PuTTYgen.
7. Connect Using the SSH Key
Use your SSH client (such as Terminal, PuTTY, or another SSH application) to connect:
ssh [email protected] -i /path/to/privatekey
How to Import an Existing SSH Key in cPanel
To import an existing SSH key into cPanel, follow these steps:
1. Log in to cPanel
Access your cPanel account with your credentials.
2. Navigate to SSH Access
Go to the Security section and click on SSH Access.
3. Manage SSH Keys
Click on Manage SSH Keys.
4. Import Key
Click the Import Key button.
- Enter a name for your key (for example, `id_rsa`).
- Open the public key file (usually `id_rsa.pub` or similar) on a local computer, copy the contents, and paste it into the Public Key field in cPanel.
- To store a private key on the server, paste it into the Private Key field. Else, you can leave this space blank for security reasons.
- If the key is secured by a passphrase, you can add it here, or leave it blank.
5. Import and Authorize the Key
- Choose Import to add the key to cPanel.
- Once imported, go back to the Manage SSH Keys section.
- Check the imported key under Public Keys, click Manage, and then click Authorize to enable it for SSH access.
By following the above steps you can configure SSH. For more information and latest updates refer https://docs.cpanel.net/cpanel/security/ssh-access/ .
Choose Cantech’s cPanel VPS hosting for Improved Security and High Performance
With Cantech’s cPanel VPS Hosting you can enjoy full control on multiple sites, and user friendly intuitive interface. Avail high speed 1 gbps connectivity with improved security and storage powered by KVM technology for maximum performance.
Contact us today and elevate your hosting experience !