For security reason, it is highly recommended that you use SSH key to login to your server via SSH instead of using root password. In this tutorial I will explain how to use SSH key to login to your server via SSH as root user.
Disable SSH Password Authorization Tweak. For security reason, you should disable SSH Password Authorization Tweak from:
WHM Home >> Security Center >> SSH Password Authorization Tweak
Now we will generate SSH key on a cPanel server. In WHM, navigate to:
WHM Home >> Security Center >> Manage root’s SSH Keys
And click Generate a New Key.
Fill the form for the new SSH key and click Generate Key button. Key name can be anything like your server name or your name. Use a strong key password. Please note, you should not use your root password.
In this step we will authorize the key. Click Manage Authorization for the key that we have generated.
And Authorize this new key.
In this step we will download the SSH key. Click View/Download Key under Private Keys section.
Enter the password that you have used in step 3 while generating this key and click convert button.
Copy the key and paste it on a notepad file. Save this text file as ssh.ppk on your computer. Please note, you may use different name for this ssh key file, but you must use .ppk extension.
So, we have generated and downloaded the SSH key. To use this SSH key with putty, we need to download Pageant.
After downloading pageant, run it and click Add Key button.
Browse and select the ssh.ppk file that we have saved in step 6. Pageant will ask for password. Enter the password that you have used in step 3. This will add the key in pageant.
Start putty and try to login to your server as root.
Done!! You will get logged in to your server as root user.