Introduction
SSH (Secure Shell) provides a secure, encrypted connection to your hosting account's command line. It's useful for advanced tasks like running scripts, managing files, using Git, or troubleshooting issues that are difficult to handle through cPanel alone.
Note: SSH access may not be enabled by default on all hosting plans. If you need SSH access and it's not available, please contact our support team to request it.
Managing SSH Keys in cPanel
SSH keys provide a more secure alternative to password-based authentication. To set up SSH keys:
- Log into cPanel
- Go to Security > SSH Access
- Click Manage SSH Keys
- Click Generate a New Key
- Enter a key name (or leave the default "id_rsa")
- Set a strong passphrase
- Choose the key type (RSA) and key size (4096 recommended)
- Click Generate Key
- Go back to the key management page and click Authorise next to your public key
Downloading Your Private Key
- In the SSH Access page, find your key under Private Keys
- Click View/Download
- Copy or download the private key to your local computer
- Save it to your SSH directory (typically ~/.ssh/ on Mac/Linux or C:\Users\YourName\.ssh\ on Windows)
Connecting via SSH
macOS and Linux (Terminal)
- Open Terminal
- Set the correct permissions on your key file:
chmod 600 ~/.ssh/id_rsa - Connect with:
ssh username@yourdomain.com -p 22 - Replace username with your cPanel username and yourdomain.com with your actual domain
- Enter your key passphrase or cPanel password when prompted
Windows (PuTTY)
- Download and install PuTTY
- If using an SSH key, convert it to PuTTY format using PuTTYgen (File > Load Private Key > Save Private Key as .ppk)
- Open PuTTY and enter your hostname (yourdomain.com) and port (22)
- Go to Connection > SSH > Auth and browse to your .ppk key file
- Click Open to connect
- Enter your cPanel username and passphrase when prompted
Windows (Windows Terminal / PowerShell)
Modern versions of Windows 10 and 11 include a built-in SSH client:
- Open Windows Terminal or PowerShell
- Connect with:
ssh username@yourdomain.com -p 22 - Enter your password or key passphrase when prompted
Common SSH Commands
ls— list files and directoriescd directoryname— change directorypwd— show current directory pathcp source destination— copy a filemv source destination— move or rename a filerm filename— delete a filetar -czf backup.tar.gz foldername— create a compressed archivetar -xzf backup.tar.gz— extract a compressed archivephp -v— check PHP versionmysql -u username -p— connect to MySQL
Security Best Practices
- Always use SSH keys rather than password-only authentication when possible
- Use a strong passphrase for your SSH key
- Never share your private key with anyone
- Keep your SSH client software up to date
If you need help with SSH access, please open a support ticket.