SSH gives you a command line on your hosting account, which is useful for WP-CLI, Composer, Git, large imports and quick file searches. On cPanel, SSH is best used with keys instead of passwords: they are more secure and you never type a password. You manage them in cPanel → Security → SSH Access.
Before you start
- SSH must be enabled for your account. If SSH Access is missing or connections are refused, open a support ticket to request it.
- An SSH client: Windows 10/11 PowerShell (built in), macOS or Linux Terminal, or PuTTY.
- If you only need a quick shell, cPanel's browser Terminal needs no setup.
Option A: import your existing key (recommended)
- On your computer, create a key if you do not have one:Press Enter to accept the path and set a passphrase.
ssh-keygen -t ed25519 -C "me@laptop" - Show the public key:
cat ~/.ssh/id_ed25519.pub(Windows:type $env:USERPROFILE\.ssh\id_ed25519.pub). - In cPanel open Security → SSH Access → Manage SSH Keys → Import Key.
- Give it a name, paste the public key into the public key box (leave the private key box empty) and click Import.
- Back in Manage SSH Keys, under Public Keys, click Manage next to the key and then Authorize.
Option B: generate a key in cPanel
- In Manage SSH Keys click + Generate a New Key.
- Enter a strong passphrase, choose RSA 4096 or the default, and click Generate Key.
- Authorize the new public key as above.
- Under Private Keys, click View/Download. Download the key; for PuTTY click Convert to get a
.ppkfile.
Warning: A private key is like a password. After downloading a key generated in cPanel, delete the private key from cPanel so it is not stored on the server.
Connect
| Setting | Value |
|---|---|
| Host | Your domain or the server hostname |
| Port | 22 unless your welcome email says otherwise |
| Username | Your cPanel username (not an email address) |
ssh -i ~/.ssh/id_ed25519 cpuser@yourdomain.comIn PuTTY, set the host, then Connection → SSH → Auth → Credentials and choose the .ppk file. See use SSH keys with PuTTY and Pageant. The same key works for SFTP in FileZilla (Logon Type: Key file).
What you can do over SSH
- Check disk use:
du -sh ~/* | sort -h - Import a database:
mysql -u cpuser_db -p cpuser_db < dump.sql - WordPress tasks with WP-CLI:
wp plugin update --all - Composer and Git commands in your project folders
Shared hosting uses a restricted (jailed) shell: you cannot use sudo or install system packages.
Troubleshooting
- Permission denied (publickey): the key is imported but not authorised, or you used the wrong username.
- Connection refused or timed out: SSH not enabled, a wrong port, or your IP is blocked after failed attempts. Contact support with your IP from the IP checker.
- Too many authentication failures: see this fix.
