What SSH Access Means on Shared Hosting
SSH access on shared hosting differs from access on a VDS: instead of a full shell with root rights, the user lands in a jailshell — an isolated environment limited to their home directory. This protects other clients on the same server: you cannot see other users' files or change system settings.
That level of access is enough for git deployment, running composer, wp-cli, npm build scripts, and ordinary file work through rsync or scp — anything that does not require changing the kernel version or installing system packages.
How to Enable SSH Access in cPanel
Under "Security", open "SSH Access" → "Manage SSH Keys". If the option is missing from the interface, hosting support enables SSH for the account on request through a support ticket — on most plans the feature is available right away, but it may be turned off by default for security reasons.
Connection details: the hostname or server IP, your cPanel username, and the SSH port — usually a nonstandard one, different from 22. The exact port is listed under "SSH Access" or in the email with the account details.
Connecting with an SSH Key
Do not use a password for SSH — a key pair is more reliable and immune to brute-forcing. Generate a pair on your own machine:
ssh-keygen -t ed25519 -C "deploy@example.com" -f ~/.ssh/zevshost_key
Add the public key (the file with the .pub extension) in cPanel through "Manage SSH Keys" → "Import Key", pasting its full content. After importing, click "Authorize" next to the key — without this step the server keeps asking for a password.
Connecting with an explicit key and port:
ssh -i ~/.ssh/zevshost_key -p 2222 username@example.com
What Jailshell Allows and What It Does Not
| Action | Allowed |
|---|---|
| Working with files inside your own directory | Yes |
| git clone, composer, npm, wp-cli | Yes |
| rsync and scp between servers | Yes |
| sudo and installing system packages | No |
| Viewing other users' processes | No |
| Changing the PHP version from the console | No, only via MultiPHP Manager |
The PHP version for CLI scripts in jailshell follows the value set in MultiPHP Manager for the domain — the php -v command only checks the current version, it does not change it.
Common Commands for Everyday Work
Checking disk usage and site structure after connecting:
cd ~/public_html
du -sh * | sort -rh | head -10
Updating a PHP project's dependencies and running a scheduled task through cron manually to test it:
composer install --no-dev --optimize-autoloader
php artisan schedule:run
Summary: a Checklist for Safe SSH Work
- Disable password login wherever the panel allows it, and use a key only.
- Keep the private key outside the repository and never send it over messaging apps.
- Use the nonstandard SSH port from the account details email, not port 22.
- Remember: jailshell does not grant root — some software installation commands will not work.
- Use MultiPHP Manager to change PHP, not shell environment variables.
Common SSH Access Errors on Shared Hosting
| Message | Cause |
|---|---|
| Permission denied (publickey) | The private key on your machine does not match the uploaded public key, or the public key was added but the Authorize button was never clicked in cPanel |
| Connection refused on port 22 | On shared hosting, SSH almost never listens on port 22 — use the nonstandard port from the account details email or the SSH Access section |
| This service allows sftp connections only | The account only has SFTP enabled, without a full shell — request shell access activation from hosting support |
| bash: composer: command not found | Composer is not installed globally inside the jailshell environment; use a local composer.phar or the built-in Composer from MultiPHP Manager |
| sudo: command not found | This is expected jailshell behavior, not an error — sudo is physically absent from the isolated environment, so privilege escalation is not possible there at all |
When SSH on Shared Hosting Stops Being Enough
- You need your own daemon listening on a port continuously (a task queue, a WebSocket server) — jailshell does not allow long-running processes outside the shared plan's limits
- You need to install system packages or PHP extensions outside the hosting's standard set — that requires root, which jailshell does not have and cannot have
- You need full control over network settings — your own firewall rules, a custom DNS resolver, kernel changes — all of that is only available on a VDS
- A frontend build (npm run build on a large project) hits the shared plan's CPU and memory limits — the process is simply killed once it hits the limit, and that limit cannot be raised for jailshell
Verifying the Result
After setting up the connection, confirm the key actually works and that you are really in jailshell, not silently refused. If jailshell's capabilities are not enough and you need to move to a VDS, start with the article on connecting to a VDS over SSH; for FTP as an alternative channel, see the article on configuring FTP in cPanel.
# Connect in verbose mode to see exactly which key was actually used
ssh -v -i ~/.ssh/zevshost_key -p 2222 username@example.com
# Confirm you are in jailshell, not a full root shell
whoami && ulimit -a