Real people, 24/7(800) 395-7779

How to Manage root's SSH Keys in WHM (Linux VPS) Print

  • root, ssh, ssh keys
  • 0

On a PeoplesHost Linux VPS, we recommend logging in to SSH as root with an SSH key instead of a password; keys are far harder to guess or steal. You can add and manage root's keys in WHM.

Step 1: Create a Key Pair on Your Computer (Recommended)

  1. Generate the key:

    • On Windows 10/11, macOS, or Linux, open a terminal and run: ssh-keygen -t ed25519
    • Choose a strong passphrase when asked. Two files are created: your private key (keep it secret) and a public key ending in .pub.
    • Older DSA keys (-t dsa) are no longer accepted by modern SSH servers; use ed25519 or RSA 4096.

Step 2: Add the Public Key in WHM

  1. Log in to WHM:

  2. Open Manage root's SSH Keys:

    • Go to Security Center > Manage root's SSH Keys (or type "SSH Keys" in the WHM search box).
  3. Import the key:

    • Click Import Key, give it a name, paste the contents of your .pub file into the public key box, and click Import.
    • Alternatively, click Generate a New Key to let WHM create a key pair, then download the private key from the key list. (PuTTY users can convert it to .ppk there.)
  4. Authorize the key:

    • In the Public Keys list, click Manage Authorization next to the key and click Authorize.

Step 3: Connect

  • Connect as root to your VPS's IP address or hostname, on port 8022, with your private key. Example: ssh -p 8022 root@your-vps-ip
  • Test the new key in a second window before closing your current session.

Troubleshooting:

  • "Permission denied (publickey)": The key is not authorized, or your SSH program is not using the matching private key.
  • Connection timed out: Check the SSH port, and make sure your IP address is not blocked by the firewall (see How to Remove a Blocked IP Address).
  • Locked out: Open a ticket with your Support PIN and we can help restore access.

Need help? Open a ticket at https://my.peopleshost.com/submitticket.php and our support team will be glad to assist.


Was this answer helpful?

« Back