First you will need to download both PuTTY and PuTTYGen.
- Run PuTTY
- In the "Host Name" field, enter your domain or server IP address.
- For "Connection>Data", enter the username you will connect with. This will probably be your root account or cPanel account.
- Click "Session" at the top left of the window. Enter a name to identify your settings.
- Click "Save".
- In PuTTY, click "Open".
- When it warns you of the possible security breach, click "Yes".
- You will now be at the bash prompt for your server.
- Start PuTTYGen.
- Select "SSH-2 RSA" under type of key to generate.
- Verify that bits are set to 1024.
- Click "Generate", and move your cursor around the blank space. This motion is used to generate the key.
- Set the key comment, which is not very important, and the password, which is important.
- Click "Save Public Key". Note where the file is saved.
- Click "Save Private Key". Note where the file is saved.
- Copy the data inside the PuTTY window under "Public Key" to paste into the SSH Authorized keys file.
- Run the following commands in PuTTY:
chmod 700 ~/.ssh
- Right click in the window to paste the key you copied earlier. Make sure it's all on one line, and not broken up into multiple lines.
- Press "ctrl"+"x", then "Y", then hit enter.
- Enter this command:
chmod 600 ~/.ssh/authorized_keys2
- Close and re-open PuTTY.
- Click the profile you made and saved earlier, and then click "Load".
- Click "SSH>Auth".
- Click "Browse". Find the private key that you saved in step 7 of "Generating an SSH Key".
- Go back to sessions, and click "Save".
Re-open PuTTY. It should make the connection to your server and send the SSH key automatically.