How to Enable and Use SSH Access Print

  • 0

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:

  1. Log into cPanel
  2. Go to Security > SSH Access
  3. Click Manage SSH Keys
  4. Click Generate a New Key
  5. Enter a key name (or leave the default "id_rsa")
  6. Set a strong passphrase
  7. Choose the key type (RSA) and key size (4096 recommended)
  8. Click Generate Key
  9. Go back to the key management page and click Authorise next to your public key

Downloading Your Private Key

  1. In the SSH Access page, find your key under Private Keys
  2. Click View/Download
  3. Copy or download the private key to your local computer
  4. 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)

  1. Open Terminal
  2. Set the correct permissions on your key file: chmod 600 ~/.ssh/id_rsa
  3. Connect with: ssh username@yourdomain.com -p 22
  4. Replace username with your cPanel username and yourdomain.com with your actual domain
  5. Enter your key passphrase or cPanel password when prompted

Windows (PuTTY)

  1. Download and install PuTTY
  2. If using an SSH key, convert it to PuTTY format using PuTTYgen (File > Load Private Key > Save Private Key as .ppk)
  3. Open PuTTY and enter your hostname (yourdomain.com) and port (22)
  4. Go to Connection > SSH > Auth and browse to your .ppk key file
  5. Click Open to connect
  6. 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:

  1. Open Windows Terminal or PowerShell
  2. Connect with: ssh username@yourdomain.com -p 22
  3. Enter your password or key passphrase when prompted

Common SSH Commands

  • ls — list files and directories
  • cd directoryname — change directory
  • pwd — show current directory path
  • cp source destination — copy a file
  • mv source destination — move or rename a file
  • rm filename — delete a file
  • tar -czf backup.tar.gz foldername — create a compressed archive
  • tar -xzf backup.tar.gz — extract a compressed archive
  • php -v — check PHP version
  • mysql -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.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution