Help center

Setting up and using SSH

Updated November 13, 2026

Setting Up and Using SSH in cPanel

Secure Shell (SSH) provides a secure, encrypted command-line connection to your web server, allowing you to manage files, run scripts, and execute server commands efficiently.

Step 1: Generate an SSH Key Pair in cPanel

  1. Log in to your cPanel account.

  2. Navigate to the Security section and click SSH Access.

  3. Click Manage SSH Keys, then select Generate a New Key.

  4. Configure your key details:

    • Key Name: Leave as id_rsa (default) or enter a custom name.

    • Key Password: Enter and confirm a strong passphrase (recommended for added security).

    • Key Type: Select RSA (or Ed25519 if supported and preferred).

    • Key Size: Select 2048 or 4096 bits.

  5. Click Generate Key.

Step 2: Authorize the Public Key

A newly generated key cannot be used until it is authorized:

  1. Return to the Manage SSH Keys screen.

  2. Locate your new key under the Public Keys section and click Manage.

  3. Click Authorize, then click Go Back to confirm the status now reads Authorized.

Step 3: Download Your Private Key

To connect from your local computer, you need the private key file:

  1. On the Manage SSH Keys page, scroll down to the Private Keys section.

  2. Click View/Download next to your key.

  3. Choose the appropriate format for your SSH client:

    • macOS / Linux / Windows Terminal (OpenSSH): Click Download Key to save the standard PEM-formatted file (e.g., id_rsa).

    • Windows (PuTTY): Enter your key passphrase under Convert the "id_rsa" key to PPK format, click Convert, and then click Download Key to save the .ppk file.

Step 4: Connect via SSH

Gather your connection details from the right-hand sidebar of your cPanel dashboard or your hosting welcome email:

  • Username: Your cPanel username

  • Hostname / IP: Your domain name or server IP address

  • Port: Default is 22 (some hosts use a custom port such as 2222 or 7822)

macOS, Linux, or Windows PowerShell / Terminal

  1. Open your terminal application.

  2. Set the required strict permissions on your downloaded private key:

    Bash

    chmod 600 ~/Downloads/id_rsa
    
  3. Connect using the following command (replace placeholders with your details):

    Bash

    ssh -i ~/Downloads/id_rsa -p PORT username@yourdomain.com
    
  4. Enter your key passphrase when prompted.

Windows (Using PuTTY)

  1. Open PuTTY.

  2. In the Session category, enter your Host Name (or IP address) and Port.

  3. In the left sidebar, expand Connection > SSH > Auth > Credentials.

  4. Click Browse next to Private key file for authentication and select your downloaded .ppk file.

  5. Return to Session (optional: save the session for future use) and click Open.

  6. Log in using your cPanel username and enter your key passphrase when prompted.

Troubleshooting Tips

  • SSH Access Missing in cPanel: Your hosting plan may have SSH disabled by default. Contact your hosting provider to request shell access.

  • Connection Refused / Timed Out: Verify you are using your host's custom SSH port rather than port 22, and check if your local IP needs to be whitelisted in your host's firewall.

  • Permission Denied (publickey): Confirm the public key is marked as Authorized in cPanel and that your local private key file permissions are set to 600.

Still stuck?

Sign in and open a ticket, and we'll help.

Sign in and open a ticket