How to Manage SSH Access in cPanel

From: Features and How-Tos Last Updated: 9 months ago

 

SSH (Secure Shell) access allows you to securely manage your website's server via command line. Managing SSH access in cPanel ensures that you can connect to your server and perform administrative tasks securely and efficiently.

Enabling SSH Access

  1. Log in to cPanel: Use your cPanel credentials to log in to your cPanel account.

  2. Locate SSH Access: In the "Security" section of the cPanel dashboard, click on the "SSH Access" icon.

  3. Manage SSH Keys: If SSH access is not already enabled, you may need to contact your hosting provider to enable it.

Generating SSH Keys

  1. Navigate to Manage SSH Keys: In the SSH Access interface, click on the “Manage SSH Keys” button.

  2. Generate a New Key:

    • Key Name: Enter a name for your new key.

    • Key Password: Create a strong password to protect your key.

    • Key Type and Size: Select the key type (RSA) and size (2048 bits or higher) for enhanced security.

    • Generate Key: Click “Generate Key” to create your SSH key.

Authorizing SSH Keys

  1. View Generated Keys: After generating your key, you’ll see it listed under “Public Keys” and “Private Keys.”

  2. Authorize Key: Click on the “Manage” link next to the public key you’ve just created, and then click “Authorize” to enable SSH access using this key.

Downloading SSH Keys

  1. Download Private Key: Under the “Private Keys” section, click the “View/Download” link next to the private key you’ve generated. Download and save this key securely on your local machine.

  2. Convert Key (if needed): If your SSH client requires a specific key format, use the “Convert” option to change the key format.

Connecting via SSH

  1. Use an SSH Client: You can use an SSH client like PuTTY (for Windows) or the terminal (for macOS/Linux) to connect to your server.

  2. Configure SSH Client:

    • Hostname/IP Address: Enter your server’s hostname or IP address.

    • Port: The default SSH port is 22 unless your hosting provider specifies a different port.

    • Authentication: Use the private key you downloaded for authentication.

  3. Connecting:

    • Windows: Open PuTTY, enter your connection details, and load your private key under “Connection > SSH > Auth” before connecting.

    • macOS/Linux: Open the terminal and use the following command to connect:

      bash
      ssh -i /path/to/private_key username@hostname
      

      Replace /path/to/private_key with the path to your private key file, username with your cPanel username, and hostname with your server’s hostname or IP address.

Managing SSH Keys

  1. Adding Additional Keys: Repeat the key generation and authorization process to add more keys if needed.

  2. Removing Keys: To remove an SSH key, click “Manage” next to the key under “Public Keys” and select “Delete Key.”

  3. Disabling SSH Access: You can revoke SSH access by deauthorizing the keys you’ve authorized earlier.

 

Managing SSH access in cPanel allows you to securely connect to your server and perform administrative tasks with ease. By following the steps outlined above, you can generate, authorize, and manage SSH keys to ensure secure access to your website's server.

Bottom ad position