How to access SSH in cPanel

From LHYcloud Docs
Jump to navigation Jump to search

You can also use cPanel > Terminal interface for small tasks. It provides an in-browser websocket interacting with SSH. It is not recommended to be used for complex tasks.

You can enable SSH access from your cPanel > Security > SSH Access or directly search for "SSH Access".

Once you open the tool, you can generate a new pair of SSH keys. You will need these keys in order to configure an SSH connection from your local computer(client) to the server. The public key is saved on the server and you will have to insert the private key in your local SSH client. We recommend using PuTTY for beginner's SSH client.

Manage SSH keys: This section of cPanel's SSH Access interface allows you to create, import, manage, and remove SSH keys.

Generating SSH Key pair

  1. Click Generate a New Key.
  2. Type in a strong password, then click in the field below it and type the password again.
  3. Click Generate Key, then you will see a Key Generation Complete! message.
Creating SSH Key Pair on cPanel.png

Authorizing the SSH Private Key

Once you have generated a SSH key pair, you have to authorize the public key to allow access to your cPanel account terminal.

Manage SSH Keys on cPanel.png
  1. Click on Manage on the public key you want to authorize.
  2. Click on Authorize button.

You can see that the authorization status changes from "not authorized" to "authorized".

Connect to your server via SSH

We will be using PuTTY client for Windows/Linux to connect to server using SSH.

PuTTY does not accept OpenSSH format private key and requires PPK private key format. You can either use cPanel converter to convert your key on cPanel and then download it or use PuTTYgen to manually convert OpenSSH format to PPK format.

  1. In the Session interface, enter the hostname or IP address of the server in the Host Name (or IP address) text box.
  2. Under category Connection > SSH > Auth, click on Credentials and attach the private key in private key for authentication.
    PuTTY Private Key authentication.png
  3. Click on Open.
  4. Enter your cPanel Username
  5. Enter the Passphrase you entered while creating the SSH Key pair.