Last updated: July 2026
Shared hosting with cPanel usually includes SSH — most people just never switch it on. With shell access you can run WP-CLI, composer, and git directly on the server instead of round-tripping files over FTP.
Step 1: Enable shell access
In cPanel, search for Manage Shell and toggle Enable SSH Access. No such icon? Your host disabled it at the package level — one support ticket (“please enable SSH/jailed shell for my account”) normally fixes that. Most hosts grant a jailed shell, confined to your home directory, which is all you need.
Step 2: Connect with your password
ssh cpaneluser@yourdomain.com
# hosts often move SSH off port 22 — commonly 2222 or 22022:
ssh -p 2222 cpaneluser@yourdomain.com
Username and password are your cPanel credentials; the port is in your hosting welcome email or your host’s docs. First connection asks to trust the host fingerprint — type yes.
Step 3: Switch to key authentication (do this)
Keys beat passwords for both security and convenience. On your Linux machine:
ssh-keygen -t ed25519 -C "laptop-to-cpanel"
ssh-copy-id -p 2222 cpaneluser@yourdomain.com
If ssh-copy-id is blocked, paste the contents of ~/.ssh/id_ed25519.pub into cPanel → SSH Access → Manage SSH Keys → Import Key, then click Manage → Authorize on the imported key — the authorize step is the one everyone misses.
Save yourself the flags with an entry in ~/.ssh/config:
Host mysite
HostName yourdomain.com
User cpaneluser
Port 2222
IdentityFile ~/.ssh/id_ed25519
Now it’s just ssh mysite.
What you can do once inside
php -v # confirm CLI PHP version
cd public_html && ls -la
wp plugin list # WP-CLI ships on most cPanel hosts
tar -czf backup.tar.gz public_html # instant full-site backup
File transfers ride the same connection — sftp mysite or scp file.zip mysite:public_html/ — so you can retire plain FTP entirely.
If the connection is refused
Three usual suspects: wrong port (ask your host), your IP tripped the server firewall after failed attempts (host can allow you in CSF), or shell access still disabled at package level. And if you get in but PHP scripts you upload start throwing 500 errors, check file ownership — see fixing the cPanel min_gid SoftException.You should be logged in by now.

One thought on “Access Shell with SSH on a cPanel Server from Linux”
Comments are closed.