SSH (Secure Shell) provides encrypted command-line access to your hosting server. It allows you to run commands, manage files, edit configurations, and perform administrative tasks that aren't possible through the cPanel web interface.
Please note: Screens and options may vary slightly depending on your cPanel version and hosting plan.⚠️ Caution: Incorrect changes here can make your website inaccessible. If you are unsure about any step, please contact our support team before proceeding.
Checking SSH Access
Not all hosting plans include SSH access. To check:
- Log in to cPanel.
- In the Security section, look for SSH Access or Terminal.
- If neither is present, contact your hosting provider to request SSH access.
Connecting via SSH
From Linux or macOS (Terminal)
ssh [email protected] -p 22
Replace username with your cPanel username and yourdomain.com with your domain or server IP. Enter your cPanel password when prompted.
From Windows
Use an SSH client such as:
- Windows Terminal / PowerShell (Windows 10+):
ssh [email protected] - PuTTY: Download from putty.org, enter the hostname and port, then click Connect.
- MobaXterm: A feature-rich terminal with built-in SFTP.
Managing SSH Keys
SSH keys provide a more secure and convenient alternative to password authentication.
Generating a Key Pair
- In cPanel, go to SSH Access.
- Click Manage SSH Keys.
- Click Generate a New Key.
- Enter a Key Name (or leave as
id_rsa). - Set a Key Password (passphrase) for extra security.
- Choose the Key Type (RSA, 4096 bits recommended).
- Click Generate Key.
Authorising a Key
After generating or importing a public key:
- On the Manage SSH Keys page, find the key under Public Keys.
- Click Manage > Authorize.
Importing an Existing Key
If you already have an SSH key pair on your local machine:
- Click Import Key.
- Paste your public key into the Public Key field.
- Click Import.
- Authorise the key as described above.
Common SSH Tasks
# Check disk usage
du -sh ~/public_html
# Find large files
find ~/public_html -type f -size +10M
# Restart a stuck process
kill -9 PID
# Edit a file
nano ~/public_html/.htaccess
# Check server load
uptime
# View running processes
top
# Import a database
mysql -u user -p database < backup.sql
Tips
- Always use SSH keys rather than password authentication when possible — they're more secure and can't be brute-forced.
- If SSH connections time out, add
ServerAliveInterval 60to your local~/.ssh/configfile to send keepalive packets. - Your SSH access is limited to your own account. You don't have root access on shared hosting.
- Use
screenortmux(if available) for long-running tasks so they continue if your connection drops.
What Next?
- Using the In-Browser Terminal — SSH access without a client.
- Setting Up Cron Jobs — Automate command-line tasks.