How to Generate and Add SSH Keys in cPanel

SSH keys allow you to log in to your server without a password. They are more secure than password-based login and recommended for regular SSH users.


Step 1 — Generate an SSH key in cPanel


  1. Log in to cPanel.
  2. Under the Security section, click SSH Access.
  3. Click Manage SSH Keys.
  4. Click Generate a New Key.
  5. Fill in the key name (or leave the default _id_rsa_), set a strong passphrase, and click Generate Key.
  6. Go back to Manage SSH Keys. Under Public Keys , find your new key and click Manage.
  7. Click Authorize to activate the key.




Step 2 — Download the private key


  1. Under Private Keys , click View/Download next to your key.
  2. Click Download Key and save the file to your computer.




Step 3 — Connect using your SSH key


On Windows (PowerShell / Windows Terminal) :


  1. Move the downloaded private key to a safe location, e.g. C:UsersYourName.sshid_rsa.
  2. Connect with: ssh -i C:UsersYourName.sshid_rsa yourusername@yourdomain.com




On macOS / Linux :


  1. Move the key to ~/.ssh/id_rsa and set permissions: chmod 600 ~/.ssh/id_rsa
  2. Connect with: ssh -i ~/.ssh/id_rsa yourusername@yourdomain.com




Using an existing local key (advanced)


If you already have an SSH key pair on your computer, you can upload the public key (.pub file) instead. In cPanel → SSH Access → Manage SSH Keys, click Import Key and paste your public key content.

Updated on: 28/04/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!