To set up SSH access using a key pair in cPanel, follow these steps:
-
Generate Key Pair in cPanel:
- Log in to your cPanel account.
- Navigate to Security > SSH/Shell Access.
- Click on Generate Key and choose a name (default is
id_dsa).
- Create a strong passphrase if required, then click Generate Key.
-
Download Private Key:
- After generating the key, download the private key file named
id_rsa.
- Save it securely on your local machine.
-
Convert Private Key to PuTTY Format:
- Download and install PuTTY (e.g.,
puttygen.exe).
- Open PuTTYGen and click File > Load Private Key.
- Browse to select your
id_rsa file, ensuring the All Files filter is active.
- Enter your passphrase if required. If no passphrase is needed, leave fields empty.
- Click Save Private Key, naming it as
.ppk for later use.
-
Configure SSH Connection with .ppk File:
- Open PuTTY and go to Connection > SSH > Auth.
- Click Browse to select your saved
.ppk file.
- Return to the session settings, inputting the server IP and port (21098).
- Click Open to connect.
-
Log in with Passphrase:
- Upon connection, you'll be prompted for your login username and passphrase.
- Enter these credentials to access your server via SSH.
-
Secure Your Keys:
- Never share your private key (
id_rsa or .ppk).
- Keep backups of your keys in a secure location.