SSH (Secure Shell) keys provide a secure way to access your hosting account without using a password. Instead, authentication is handled through a public/private key pair. cPanel makes it easy to generate, manage, and authorize SSH keys.
Why Use SSH Keys?
-
Stronger security than passwords.
-
Prevents brute‑force login attempts.
-
Convenient for developers who frequently access servers.
-
Required for some automated deployments and Git operations.
Steps to Generate and Configure SSH Keys in cPanel
1. Generate a New Key Pair
-
Log in to cPanel.
-
On the Tools page → Security section, click SSH Access.
-
Click Manage SSH Keys.
-
Under Generate a New Key, fill in:
-
Key Name → Optional identifier (default:
id_rsa). -
Key Password → Protects your private key.
-
Key Type → RSA recommended.
-
Key Size → Choose 2048 or 4096 bits (larger = stronger security).
-
-
Click Generate Key.
-
The key pair is created and stored on the server.
2. Authorize the Public Key
-
In Manage SSH Keys, locate the key you generated.
-
Click Manage Authorization.
-
Click Authorize → the public key is now trusted for SSH access.
3. Download the Private Key
-
In Manage SSH Keys, locate your key.
-
Click View/Download.
-
Copy or download the private key to your local machine.
-
Save it securely (e.g.,
~/.ssh/id_rsa). -
Adjust file permissions:
chmod 600 ~/.ssh/id_rsa
4. Connect Using SSH
-
Open a terminal (Linux/macOS) or use PuTTY (Windows).
-
Run:
ssh -i ~/.ssh/id_rsa username@hostnameReplaceusernamewith your cPanel username.-
Replace
hostnamewith your server’s domain or IP.
-
Notes
|