How to Use SSH, SSH Keys and Terminal in cPanel

SSH gives you a command line on your Instant Access Internet Services hosting account, which is handy for tools like Git, WP-CLI, Composer and bulk file work. This guide explains how to use cPanel's built-in Terminal, how to connect with SSH from your own computer, and how to create and authorize SSH keys in cPanel.

Before you start

  • Commands run with your account's full permissions. A wrong command (for example a careless rm) can delete your website or email, so only use the command line if you're comfortable with it. Backups are kept, but restoring takes time.
  • Your account runs in a secure, isolated environment (CloudLinux CageFS), so you see your own files and common tools, not the rest of the server. You can't use sudo or install system software.
  • Repeated failed logins can get your IP address temporarily blocked by the firewall. If you suddenly can't connect to anything, open a ticket with your IP address from whatismyipaddress.com.
  • If you don't see Terminal in cPanel, or SSH logins are refused with the correct password, your account may not have shell access turned on. Open a ticket and ask.

How to use Terminal in cPanel

Terminal is the quickest way to get a command line: it runs in your browser, so there's nothing to install.

  1. Log in to cPanel and go to Advanced > Terminal.
  2. The first time, read the warning and click I understand and want to proceed. It won't be shown again.
  3. A command prompt opens in your home directory (/home/username). Try ls to list your files or cd public_html to go to your website folder.

If you log out of cPanel, open Terminal sessions close shortly afterwards (commands already running keep going). Click Reconnect to start a new session.

How to connect with SSH from your computer

Windows 10 and 11, macOS and Linux all include an SSH client. Open Terminal (Mac/Linux) or Windows Terminal / PowerShell (Windows) and run:

ssh username@example.com

Replace username with your cPanel username and example.com with your domain (or secure.instantaccess.net if your domain isn't pointed at us yet). The first time, type yes to accept the server's fingerprint, then enter your cPanel password. SSH uses the standard port, 22, so you don't need to specify it. PuTTY also works if you prefer it: enter the same host name, port 22 and connection type SSH.

How to set up SSH keys (recommended)

An SSH key lets you log in without typing your password, and is much harder to guess. You can create the key on your own computer (best) or in cPanel.

Option 1: Create a key on your computer and import the public key

  1. On your computer, run ssh-keygen -t ed25519 -C "you@example.com" and press Enter to accept the default location. Set a passphrase for extra protection if you like.
  2. Display the public key: cat ~/.ssh/id_ed25519.pub (on Windows: type $env:USERPROFILE\.ssh\id_ed25519.pub in PowerShell). Copy the whole line.
  3. In cPanel, go to Security > SSH Access and click Manage SSH Keys.
  4. Click Import Key, give it a name (for example laptop), paste the line into the public key box, and leave the private key box empty. Click Import.
  5. Go back to Manage SSH Keys. Under Public Keys, click Manage next to the new key, then click Authorize.

Your private key never leaves your computer, which is the safest arrangement.

Option 2: Generate a key in cPanel

  1. Go to Security > SSH Access > Manage SSH Keys and click Generate a New Key.
  2. Enter a Key Name (or keep id_rsa), a strong Key Password, choose RSA as the Key Type and a key size of 4096, then click Generate Key.
  3. Back on Manage SSH Keys, click Manage next to the new public key and click Authorize. A key won't work until it's authorized.
  4. Under Private Keys, click View/Download next to the key and download it to your computer. Store it somewhere safe (for example ~/.ssh/). PuTTY users can load it into PuTTYgen to save it in PuTTY's .ppk format.
  5. Connect with ssh -i path/to/key username@example.com and enter the key password when asked.

Troubleshooting

"Permission denied (publickey,password)"

Check the username is your cPanel username (not your email address), and that the key is authorized in Manage SSH Keys. On your computer, private key files must be readable only by you: on Mac/Linux run chmod 600 ~/.ssh/id_ed25519.

The connection times out

Your IP address may have been blocked after failed logins, or your network may block outgoing SSH. Try Terminal in cPanel instead, and open a ticket with your IP address if the problem continues.

How do I stop a key from working?

In Manage SSH Keys, click Manage next to the key and choose Deauthorize, or use Delete Key to remove it completely. Do this straight away if a laptop with your key is lost or stolen.

Related guides

Still stuck? Open a support ticket and the Instant Access Internet Services team will help.

Ultrafast LiteSpeed hosting from InstantAccess.net: free SSL, free backups, cPanel included, no contracts. Check out our $10/month hosting.
  • cpanel ssh access, cpanel ssh keys, cpanel terminal, generate ssh key cpanel, authorize ssh key, connect to hosting with ssh
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Change Your PHP Version in cPanel

Running a current PHP version keeps your website faster and more secure, and many WordPress...

How to Change PHP Settings (memory_limit, upload_max_filesize)

If WordPress says "The uploaded file exceeds the upload_max_filesize directive", a plugin runs...

How to Set Up a Cron Job in cPanel

A cron job runs a command or script on a schedule, such as every hour or once a night, without...

How to Check Your Website Error Log and Recent Visitors

When your website shows a blank page, a "500 Internal Server Error" or a feature just stops...

How to View Website Statistics with AWStats and Bandwidth

Your Instant Access Internet Services hosting account includes built-in website statistics, so...