First, login to WHM and navigate to Home -> Security Center -> Manage root's SSH Keys.
Then, follow these steps:
- Click on the Import Key button
- Enter a name for this key in the first field
- Paste the public key in the corresponding field
- Click the Import button
*There are fields for Password and Private Key which are not required
Now, you need to authorize this key for the root user. To do this, go back to Manage root's SSH Keys and click on the Manage Authorization button next to the key you've just added.
Finally, click on the Authorize button. You can now login to your server as root using this key.