How To Set up SSH Key on a cPanel Server

Needed tools :

  1. pageant.exe (an SSH authentication agent for PuTTY, PSCP, PSFTP, and Plink)
  2. putty.exe (the SSH and Telnet client)


These are downloaded from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html.




Step 1 - Create root's SSH key from WHM

  1. Log into WHM https://x.x.x.x:2087 ( x.x.x.x is your cPanel server IP )
  2. Search for "Manage root’s SSH Keys" and enter this function.
  3. Click Generate a New Key.
  4. Fill in the key info.
  5. Enable the public key
  6. Convert private key to Putty PPK format. So that can add the key at pageant tool.
    • Copy the converted key, save into a file with .ppk extension. For example, server_key.ppk.


Step 2 - Add the private key to pageant.exe for server remote authentication via SSH key.

  1. Open pageant.exe from your computer and will appear at Windows taskbar
  2. Add private key( PPK format file ).
  3. Enter private key passphare that prompts.
  4. Done adding the private key.
  5. Open a new session from putty, entering your CentOS server IP and SSH port. A custom SSH port 8288 is configured for our server.
  6. Enter username "root", hit enter to remotely access the server with SSH key.




To security reason, it is recommended to leave SSH password authentication disabled. This simply means that password authentication is disabled and have to use SSH key for remotely accessing server.

  1. Log into WHM https://x.x.x.x:2087 ( x.x.x.x is your cPanel server IP )
  2. Search and click SSH Password Authorization Tweak.
  3. Press Disabled Password Auth.



The failure login with SSH key demonstration.


The success login through SSH key demonstration.


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.