Enabling SSH Access in cPanel
SSH (Secure Shell) provides command-line access to your cPanel hosting account. SSH is available on all our shared hosting plans via CloudLinux.
SSH Connection Details
| Setting | Value |
|---|---|
| Hostname | Your server hostname (check your welcome email or cPanel) |
| Port | 22 |
| Username | Your cPanel username |
| Password | Your cPanel password |
Connecting via SSH
On macOS / Linux
Open Terminal and run:
bash
ssh [email protected]On Windows
Use PuTTY or Windows Terminal:
Setting Up SSH Keys in cPanel
Step 1: Generate Keys in cPanel
- Log in to cPanel
- Go to Security > SSH Access
- Click Manage SSH Keys
- Click Generate a New Key
- Set a key name and passphrase (or leave passphrase empty for passwordless login)
- Choose RSA and 4096 bits
- Click Generate Key
Step 2: Authorize the Public Key
- In the SSH Keys list, find your new key
- Click Manage next to the public key
- Click Authorize
Step 3: Download the Private Key
- Click View/Download next to the private key
- Save the key file to your local machine (e.g.,
~/.ssh/id_rsa_cpanel) - Set correct permissions:
bash
chmod 600 ~/.ssh/id_rsa_cpanelStep 4: Connect Using the Key
bash
ssh -i ~/.ssh/id_rsa_cpanel [email protected]Importing Existing SSH Keys
If you already have an SSH key pair:
- Go to SSH Access > Manage SSH Keys > Import Key
- Paste your public key content
- Click Import
- Click Manage > Authorize the imported key
Common SSH Commands for cPanel
bash
# Navigate to your website
cd ~/public_html
# Check PHP version
php -v
# WordPress CLI
wp core version
wp plugin list
wp cache flush
# Check disk usage
du -sh ~/public_html
# Database operations
mysql -u dbuser -p dbname
# Composer
composer install
composer update
# Node.js
node -v
npm installFile Paths
| Path | Description |
|---|---|
/home/username/ | Home directory |
/home/username/public_html/ | Website root |
/home/username/mail/ | Email data |
/home/username/logs/ | Access and error logs |
/home/username/.htaccess | Home directory htaccess |
Troubleshooting
Connection Refused
- Verify hostname and port 22
- Your IP may have been blocked — contact support
- Some ISPs block port 22 — try using a VPN
Permission Denied
- Verify credentials
- If using SSH keys, ensure the key is authorized in cPanel
- Check key file permissions (600)
Timeout
- Try a different network connection
- Verify the server hostname is correct
Related Articles
Need help? Contact our support team at {{SUPPORT_EMAIL}} or open a ticket at {{SUPPORT_URL}}.