SSH Access and Command-Line Tools on Shared Hosting
For many developers, shared hosting feels like a place where you click through a control panel and upload files by FTP. But if your host gives you SSH access, the same account becomes far more capable. You can deploy code with Git, export a database in seconds, update WordPress plugins in bulk, schedule scripts and diagnose errors without leaving your terminal.
This guide covers SSH access on shared hosting from start to finish: how to connect securely with keys, the commands you will use every day, how to work with Git, databases, WP-CLI, Composer and cron jobs, what shared hosting limits you cannot get around, and the safe habits that keep you from breaking your site.
Key takeaways
SSH (Secure Shell) gives you an encrypted command-line connection to your hosting account. It is faster, more scriptable and more precise than a web file manager.
Whether SSH is available depends on your host and your plan, and on shared hosting it is normally a restricted shell with no root access.
Use SSH keys with a passphrase instead of passwords.
A small set of commands covers most daily work: navigation, searching logs, permissions, archives, rsync, Git, mysqldump and WP-CLI.
Always take a backup before running bulk or destructive commands, and use dry-run options when a tool offers them.
When a project outgrows shared hosting, developer hosting or VPS and cloud hosting give you more control.
What Is SSH, and Why Use It on Shared Hosting?
SSH is a protocol for logging in to a remote server over an encrypted connection and running commands as if you were sitting at its keyboard. It replaced older, unencrypted tools such as Telnet and typically uses port 22, although some hosts choose a different port.
On a shared hosting account, SSH brings real advantages:
Speed. Copying, archiving and searching thousands of files takes seconds in a terminal, not minutes in a browser.
Precision. You can search every file for a string, change permissions in bulk or see exactly what a log says.
Automation. Anything you can type you can script, schedule with cron and repeat identically.
Better deployments. Pulling code with Git or syncing with rsync is safer than dragging files over FTP.
Direct tooling. WP-CLI, Composer and database utilities run right where your site lives.
What You Can and Cannot Do on Shared Hosting
Shared hosting means many accounts live on one server, so your access is deliberately limited. Knowing the boundaries saves frustration.
What you can usually do:
Work inside your own home directory and your own websites
Run PHP scripts, Git, Composer, rsync, tar, zip and database tools, if installed
Edit your own cron jobs
Use WP-CLI and other tools you install in your home directory
What you usually cannot do:
Use root or sudo, install system packages with apt or yum, or change server-wide settings
See or control other users' processes or files, because accounts are isolated from each other
Run services or long-lived background processes without restriction
Use more CPU, memory or processes than your account limits allow
If you regularly need any of the second list, you have outgrown shared hosting. That is the point to look at a VPS, which gives you dedicated resources and full root access.
Does Your Hosting Plan Include SSH?
SSH is a plan and host decision, not a universal feature. To find out:
Look at the features list for your plan, or the plan limits page, for SSH or shell access.
Open your control panel. In cPanel, an SSH Access page under the Security section lets you manage keys, and a Terminal tool, where enabled, opens a shell in your browser.
Ask SteboHost support if you cannot find it.
If SSH is not enabled on your account, support can tell you which plan or product provides it.
Step 1: Connect With SSH Keys
Passwords can be guessed, reused or leaked. SSH keys are a pair of files: a private key that stays on your computer and a public key you give to the server. Anyone without the private key cannot log in.
Generate a key pair
On macOS, Linux, or Windows 10 and 11 (which include an OpenSSH client), open a terminal and run:
ssh-keygen -t ed25519 -C "you@example.com"Accept the default location and set a passphrase. This creates a private key (id_ed25519) and a public key (id_ed25519.pub) in your .ssh folder. Never share or upload the private key.
Authorise the public key on the server
In cPanel, open SSH Access, import your public key, then authorise it so it can be used to log in. Alternatively, if password login is enabled, you can copy the key from your terminal:
ssh-copy-id -p 22 username@yourdomain.comConnect
Use the username, host name and port your hosting provider gives you:
ssh -p 22 username@yourdomain.comThe first time, you will be asked to confirm the server's fingerprint. Accept only if you trust the host.
Save time with an SSH config file
Add a shortcut to the file ~/.ssh/config so you can type ssh mysite:
Host mysite
HostName yourdomain.com
User username
Port 22
IdentityFile ~/.ssh/id_ed25519On Windows you can use the built-in OpenSSH client in PowerShell or Windows Terminal, or a client such as PuTTY.
Essential Commands Every Developer Should Know
Navigate and inspect
pwd # show where you are
ls -la # list all files with permissions and sizes
cd public_html # change directory
cd .. # go up one levelOn many cPanel accounts, your websites live under public_html or in a folder per domain. Run ls to find out where yours are.
Read files and watch logs
cat file.txt # print a small file
less error_log # scroll through a big file (q to quit)
tail -n 50 error_log # last 50 lines
tail -f error_log # follow a log live (Ctrl+C to stop)PHP errors are often written to files named error_log inside your site folders, and many cPanel setups keep access logs in a logs folder in your home directory. Watching the log while you reproduce a problem is one of the fastest ways to debug.
Search
grep -rn "function_name" . # find text in all files below here
find . -name "*.php" -mtime -2 # PHP files changed in the last 2 daysThe second command is also a quick first check if you suspect unexpected changes to your site.
Copy, move and delete
mkdir -p backups/2026-10
cp -r public_html/wp-content backups/2026-10/
mv oldname.php newname.php
rm file.txtThere is no recycle bin on the command line. Deleted means gone, unless you have a backup. Run ls first to check what a pattern matches before you delete it, and be extremely careful with rm -r.
Set permissions
A safe, common default on cPanel hosting is 755 for folders and 644 for files:
find . -type d -exec chmod 755 {} +
find . -type f -exec chmod 644 {} +Avoid 777. It lets anyone on the system write to the file and is a common cause of compromised sites. Some applications need tighter permissions on particular files, such as wp-config.php, so follow the application's guidance.
Archive and extract
tar -czf site-backup.tar.gz public_html # create a compressed archive
tar -xzf site-backup.tar.gz # extract it
zip -r site.zip public_html # make a zip
unzip site.zip # extract a zipCheck disk usage
du -sh * # size of each item in this folder
du -sh * | sort -h # sorted from smallest to largestThis is useful when your account is approaching its storage limit and you need to find what is using the space.
Transfer Files Securely: scp, sftp and rsync
All three work over SSH, so they are encrypted.
scp copies single files or folders:
scp backup.sql username@yourdomain.com:~/backups/sftp gives you an interactive file-transfer session, and works with graphical clients such as FileZilla.
rsync is the best tool for deployments and backups because it copies only what changed:
rsync -avz --dry-run -e ssh ./build/ username@yourdomain.com:~/public_html/The --dry-run flag shows what would happen without changing anything. Remove it when you are happy. Be careful with the --delete option, which removes files on the server that are not in your source, and always check the trailing slash on the source path because it changes what is copied.
Deploy With Git
Git lets you deploy by pulling tested code instead of uploading files by hand. Check whether it is available:
git --versionA simple workflow is to clone your repository once and then update it:
git clone git@github.com:yourname/yourrepo.git
cd yourrepo
git pull origin mainFor private repositories, use a deploy key (a key pair created for one repository, ideally with read-only access) rather than your personal credentials.
Important security note: if your repository sits directly in your web root, the hidden .git folder can end up publicly accessible. Keep the repository outside the web root and deploy the built files into it, or block access to .git in your .htaccess file:
RedirectMatch 404 /\.gitAlways test deployments on a staging copy first. Managed WordPress plans with staging, such as managed WordPress hosting, make this easier.
Work With Databases From the Command Line
Database tools beat browser-based importers for large files. On cPanel hosting, database and user names usually carry your account name as a prefix.
mysqldump -u dbuser -p dbname > backup.sql # export
mysql -u dbuser -p dbname < backup.sql # importThe -p flag makes the tool ask for the password, which keeps it out of your shell history. Compress large dumps by piping to gzip, and keep them out of any publicly accessible folder.
WP-CLI for WordPress
WP-CLI is the official command-line tool for WordPress. Check whether it is installed with wp --info. If not, you can usually install it in your home directory by downloading the phar file from WP-CLI's official site.
wp core version
wp plugin list
wp plugin update --all
wp theme list
wp cache flush
wp db export backup.sql
wp search-replace 'http://old.example' 'https://new.example' --skip-columns=guid --dry-runUse the dry run before every search-replace. WP-CLI is also useful when the dashboard will not load, for example to deactivate a plugin that caused a fatal error with wp plugin deactivate plugin-name.
Composer and the Right PHP Version
Composer manages PHP dependencies. A typical production install looks like this:
composer install --no-dev --optimize-autoloaderA classic shared-hosting trap: the PHP version used by the command line can differ from the version your website uses. Check with php -v. On many cPanel servers using EasyApache, each PHP version has its own binary under a path such as /opt/cpanel/ea-php83/root/usr/bin/php, so you can run a specific version explicitly:
/opt/cpanel/ea-php83/root/usr/bin/php -vThe exact path depends on the server, so confirm it with your host. Matching versions avoids errors where Composer resolves packages for one PHP version and your site runs another. If you are unsure which version to run, our guide to PHP versions and website speed explains how to choose.
Node.js and Python on Shared Hosting
Build tools and scripts are often fine, but running persistent application servers is a different matter. Some cPanel hosts provide a Node.js or Python application tool that handles the web server side, while others allow neither. Long-running background processes are commonly restricted on shared plans. If you need to run your own app server, a process manager or Docker, you need developer hosting or a VPS with the control that those provide.
Schedule Tasks With Cron
Cron runs commands on a schedule. List and edit your jobs with:
crontab -l
crontab -eEach line has five time fields followed by the command: minute, hour, day of month, month and day of week.
0 2 * * * /usr/local/bin/php /home/username/scripts/cleanup.php
*/15 * * * * /usr/local/bin/php /home/username/public_html/cron-task.phpThe first runs daily at 02:00 and the second every 15 minutes. Use full paths, because cron runs with a minimal environment, and confirm the PHP path with your host. Redirect output to a log file (add >> ~/cron.log 2>&1) so you can see failures. Many cPanel accounts also have a Cron Jobs page that does the same thing through a form, and some hosts limit how often jobs may run.
Monitor and Troubleshoot
Check resource use:
toporps auxshows your processes. On shared hosting you typically only see your own.Find big files:
du -sh * | sort -h.Look at recent changes:
find . -type f -mtime -1lists files modified in the last day.Read the logs:
tail -f error_logwhile you reload the page.Be aware of limits: shared servers usually cap CPU, memory and process counts per account, so a heavy import or archive may be slowed or killed.
Security Habits for SSH on Shared Hosting
Use key-based login with a passphrase, and keep your private key private (permissions 600 on the key file).
Never type passwords or API keys into commands. They end up in your shell history and in process lists.
Never run a command you found online if you do not understand it, especially anything that pipes a download straight into a shell.
Take a backup before any bulk change, and use dry-run options where they exist.
Do not leave dumps, archives or phpinfo files in folders reachable from the web.
Remove SSH keys you no longer use, and use separate keys per device.
Keep software updated, and layer protection such as a firewall and malware scanning. See website security for what is included on SteboHost.
Common SSH Errors and Fixes
Permission denied (publickey). The public key is not authorised, you are using the wrong username, or the private key file permissions are too open. Check your cPanel SSH Access settings and run chmod 600 on the key.
Connection refused or timed out. SSH may not be enabled on your plan, the port may be different, or a firewall or network is blocking it. Confirm the port with your host.
Host key verification failed. The server's fingerprint has changed, possibly after a migration or reinstall. Verify the change with your host before removing the old entry from known_hosts.
Command not found. The tool is not installed or not in your PATH. Install it in your home directory or ask your host.
Disk quota exceeded. Your account is full. Find and remove large files, old backups and logs.
Killed. The process hit an account resource limit. Break the job into smaller chunks, run it at a quieter time or move to a plan with more resources.
Quick Command Cheat Sheet
Task | Command |
|---|---|
Show current folder |
|
List files with details |
|
Follow a log live |
|
Search text in files |
|
Find recently changed files |
|
Make an archive |
|
Check folder sizes |
|
Sync files safely |
|
Update from Git |
|
Export a database |
|
List WordPress plugins |
|
Edit cron jobs |
|
Why SteboHost Is a Good Home for Developers
SteboHost gives developers a stable base and clear upgrade paths as projects grow:
cPanel on LiteSpeed with NVMe storage, so deployments and sites run on fast, familiar infrastructure.
Daily backups with 7-day retention and one-click restore, which is the safety net you want before running bulk commands. Read more about backup and disaster recovery.
WAF, malware scanning and free SSL on every plan, plus 24/7 infrastructure monitoring and a 99.9% uptime SLA.
Managed WordPress with staging, so you can test changes before they go live.
Free migration on annual plans, with your site, databases, email and DNS moved from your current host.
Room to grow. Developer hosting is available for workflow-focused projects, and VPS and cloud hosting offers dedicated CPU and RAM, full root access, Ubuntu, Debian and AlmaLinux images and snapshot backups.
Support in your timezone, on +254 703 610 464, and billing in KES by M-Pesa, card or bank transfer.
Current plan and renewal prices are shown before you buy. Compare plans and pricing or browse the knowledge base for more guides.
Conclusion
SSH turns shared hosting from a place you upload files to into a place you can work. With key-based login, a dozen essential commands and a few tools such as Git, rsync, mysqldump, WP-CLI and cron, you can deploy faster, debug sooner and automate the boring parts. Respect the limits of shared hosting, protect yourself with backups and dry runs, and move up to developer hosting or a VPS when your project needs more control.
Ready to host your next project on a platform that grows with you? Explore SteboHost web hosting, or call +254 703 610 464 or email support@stebohost.com to ask which plan fits your workflow.
Frequently Asked Questions
Does shared hosting include SSH access?
Some do and some do not. Many cPanel-based hosts offer SSH on certain plans, usually as a restricted shell, while others reserve it for developer or VPS plans. Check your plan's features or ask your host.
Is SSH safe to use on shared hosting?
Yes, when used properly. SSH encrypts everything between your computer and the server. Use key-based login with a passphrase, keep your private key secret and avoid putting passwords in commands. Server-side isolation between accounts is handled by the host.
Can I get root or sudo access on shared hosting?
No. Root access would let you affect every other account on the server, so it is not provided on shared hosting. If you need root, choose a VPS, such as SteboHost's VPS and cloud hosting, or a dedicated server.
What is the difference between SSH, SFTP and FTP?
SSH gives you a command-line shell. SFTP is a file-transfer protocol that runs over SSH, so it is encrypted. FTP is an older protocol that is not encrypted by default, so SFTP is the safer choice for file transfers.
Can I use Git on shared hosting?
Often yes, if Git is installed on the server or your host offers a Git feature in the control panel. Run git --version to check. Keep repositories outside the web root, or block access to the .git folder, so your source history is never publicly accessible.
Can I run Node.js or Python apps on shared hosting?
Sometimes, depending on the host. Some offer application tools for Node.js or Python, but long-running processes are often restricted. For full control over runtimes and background services, use developer hosting or a VPS.
What should I do if my host does not offer SSH?
Use the control panel's File Manager, SFTP or Git integration where available, and ask the host whether SSH is possible on another plan. If SSH is essential to your workflow, moving to a host or plan that supports it is usually worth it, and SteboHost offers free migration on annual plans.
Written by Denis Makokha
SteboHost engineering and operations team. We write practical guides on hosting, domains, email and security for African businesses — based on what we see in the field, not marketing copy.
Ready to get started?
Browse our hosting plans or contact our team for help choosing the right one.