Using SSH with cPanel: A Simple Guide

SSH (Secure Shell) allows remote access to your hosting server’s command line, giving you full control to manage files, install software, and troubleshoot. Many hosting providers, such as Bluehost offer an Online Terminal within cPanel, simplifying access for users. This terminal allows you to execute commands without additional setup or external tools, making it perfect for tasks like running installation scripts, such as the Smart Report Maker (SRM) installer.


Benefits of an Online Terminal in cPanel

If your hosting provider includes an Online Terminal, here’s how you can get started with it:

  1. Log in to cPanel.
  2. Find Terminal under the Advanced section or search for “Terminal” in the search bar.
  3. Click Open Terminal and confirm any warning messages to proceed.
  4. Start running your commands right away.
Locating the terminal in cPanel under the Advanced section

What If the Online Terminal Is Not Available?

If online terminal is not available in your cPanel you have three possible scenarios:

1- SSH is enabled, and you can log in with your cPanel password

  • This allows easy access to your server from your local machine’s terminal without any extra setup.
  • Steps to Use SSH with a Password:
    • Open a Terminal on your local computer:
      • Windows: Use Command Prompt or PowerShell.
      • macOS/Linux: Use the Terminal app.
    • Log in with the following command:
ssh cpanel_username@server_ip
  • Replace:
    • cpanel_username with your cPanel username.
    • server_ip with your server’s IP address.
  • Enter your cPanel password when prompted.
    If the credentials are correct, you will be logged in to the server’s command line.

2- SSH is enabled, but password login is disabled (Keys Required)

For better security, some providers disable password authentication and require SSH keys for login.

What Are SSH Keys?

SSH keys are a pair of files:

  • Public Key: Stored on the server to verify access.
  • Private Key: Kept on your local machine and used for authentication.

How to Set Up and Use SSH Keys:

  • Generate SSH Keys on Your Local Machine.
ssh-keygen -t rsa -b 4096

Key Location after SSH Key Generation
After running the previous command, the keys should be generated at the following location:

Windows:
C:\Users\<Your-Username>\.ssh\id_rsa (private)
C:\Users\<Your-Username>\.ssh\id_rsa.pub (public)

Linux/macOS:
~/.ssh/id_rsa (private)
~/.ssh/id_rsa.pub (public)

Then, you need to upload the Public Key `id_rsa.pub` to cPanel:

  • Log in to cPanel.
  • Go to SSH Access. In the Security section, click on SSH Access.
  • Click Manage SSH Keys and choose Import Key.
  • Paste the contents of your public key (id_rsa.pub) , then Click Import. After import, click Manage next to the key and select Authorize.

Finally, Log in Using Your Private Key:

Use the following command from your local terminal, if your local machine is Linux , macOS or you are using WSL (Windows Subsystem for Linux)

ssh -i ~/.ssh/id_rsa cpanel_username@server_ip

In case of windows you should use the following command instead:

ssh -i C:\Users\your-username\.ssh\id_rsa cpanel_username@server_ip
  • Replace:
    • cpanel_username with your cPanel username.
    • server_ip with your server’s IP address.

3- SSH Not Enabled – Contact Support

If SSH is not enabled, attempting to log in may return the following message:

“Shell access is not enabled on your account! If you need shell access, please contact support.”

In this case, you’ll need to either:

  • Check cPanel > SSH Access to see if you can enable SSH yourself.
  • Contact support and request SSH access for your account.

Summary

Using SSH with cPanel gives you powerful control over your server. If your provider offers an Online Terminal, you can manage tasks right from your browser. If not, SSH from your local machine using either passwords or SSH keys ensures secure remote access. Always check if SSH is enabled—if not, contact support to activate it.