StarDomain

Enabling SSH Access in cPanel

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

SettingValue
HostnameYour server hostname (check your welcome email or cPanel)
Port22
UsernameYour cPanel username
PasswordYour 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

  1. Log in to cPanel
  2. Go to Security > SSH Access
  3. Click Manage SSH Keys
  4. Click Generate a New Key
  5. Set a key name and passphrase (or leave passphrase empty for passwordless login)
  6. Choose RSA and 4096 bits
  7. Click Generate Key

Step 2: Authorize the Public Key

  1. In the SSH Keys list, find your new key
  2. Click Manage next to the public key
  3. Click Authorize

Step 3: Download the Private Key

  1. Click View/Download next to the private key
  2. Save the key file to your local machine (e.g., ~/.ssh/id_rsa_cpanel)
  3. Set correct permissions:
bash
chmod 600 ~/.ssh/id_rsa_cpanel

Step 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:

  1. Go to SSH Access > Manage SSH Keys > Import Key
  2. Paste your public key content
  3. Click Import
  4. 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 install

File Paths

PathDescription
/home/username/Home directory
/home/username/public_html/Website root
/home/username/mail/Email data
/home/username/logs/Access and error logs
/home/username/.htaccessHome 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

Need help? Contact our support team at {{SUPPORT_EMAIL}} or open a ticket at {{SUPPORT_URL}}.