Using Public Keys With Putty to Connect to WHM running on Linux

So the other day I wanted to set up SSH with public keys through putty so I could connect to WHM. While i did find the instructions on how to do it they were lacking a lot of information after a lot of google I was able to figure it out. So I figured The findings should be shared with everyone. Here is a step by step guide that should make someone’s life a little easier:

Part A – Setting up your Public Keys

1- Log in into your WHM and go to “SSH Password Authorization Tweak” under “Security Center”

2- Disable Password Auth – this is so we can only access ssh with a key

3 – Go to “Manage root’s SSH Keys” under “Security Center”

4 – Click on “Generate a New Key”

5 – leave the key name as root and create a password

6 – Click Generate Key

7 – Go back to “Manage root’s SSH Keys” and click on “Manage Authorization” on the public key

8 – Enable authorization and go back to “Manage root’s SSH Keys”

9 – click on “View/Download” on the private key

10 – type the password you used when creating the key into the passphrase box and click “Convert”

11 – copy the text generated and save it to your desktop in a file with extension .ppk (you can name this whatever you want)

Part B – Connecting with Putty

For putty to use the private key correctly you need to open the private key with “pageant” this is provided for free with putty if you use the everything installer or downloaded individually from putty’s download page. I recommend you download the “Windows Installer for Everything” from:

Download Page for Putty

1 – Open the .ppk file with Pageant if you used the installer and did not change the defaultĀ  file association settings then you should be able to just double click the file.

2 – You will be asked for the password – enter the password used in the creation of the key

3 – Open Putty and enter the address of your web server – Make sure you click on SSH

4 – When you click connect type the user we set up when creating the key in this case it was root

If everything was setup right you should have SSH access to your web server now

 

14 Comments



    1. Thanks for the post back. Your explanations is very thorough good job

      Reply

  1. Hey! Thank you so much for this. I was unable to connect to Putty, but this tutorial was excellent. Thanks for real!

    Reply

    1. No problem. maybe you missed a step? every time I need to set up ssh access, I come back to this article. I can never remember the steps but this works every time. I would love to help you if you give me some more details.

      Reply

  2. I’m totally lost, I still don’t get it and am finding it so frustrating

    Reply

  3. item 11 – copy the text generated … save into a file …

    What, do you save ALL the text in the box into one file ? The public key and the private key and the notational text at the top of the box too ?

    Reply

    1. Yes, whatever was generated in the text box

      Reply

  4. I have struggled with this for ages – worked first time. Thank you so much!

    Reply

  5. For some reason, my (PuTTY PPK format): Box comes empty.
    I have tried this multiple times. yet the box comes empty.
    I followed your steps to the end.

    Reply

  6. I found a workaround for that problem using putty key generator though.
    Thank you.

    Reply

  7. Dear Carlos Roque,

    What a great tutorial , that you was wrote..! I was very tired before 3 month to login ssh with putty. Now my concept is clear. Lot of thanks Boss.

    Reply

  8. Finally! Instructions that actually made sense!

    Thank you so, so very much!!!

    Reply

  9. Super useful little tutorial thanks. I had been doing it another way but this seems to make things a lot quicker when logging in (no password required each time).
    Cheers

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *