How to configure a SSH connection on cPanel

First configure the SSH access on Server

  1. In the home page of cPanel go to “SSH Access”
  2. Click “Manage SSH keys”
  3. Click “Generate Key”
  4. Set a key name and set the key password(this is the passphrase to connect to the server). Leave the others fields with the data by default
  5. Click “Generate Key”
  6. On “Manage SSH Keys” select “Manage” in the new key generated
  7. Click “Authorize”
  8. On “Manage SSH Keys” select “View/Download” on “Private Keys”
  9. Click “Download Key” and save the file as “keyname.key”
  10. Move the downloaded key to a folder where you store your keys, example: ~/.ssh
  11. Change the permission of the copied file to 600 with the chmod command
  12. In the home page of cPanel go to “Manage SSH”
  13. Enable the option “Enable SSH access”

Let’s configure the SSH connection on the machine. NOTE: This example apply for Mac

Create a file called “config” on path ~/.ssh (you can pick whatever you want)

Host hostname
  HostName IP Address/Hostname
  User username
  Port 9999
  IdentityFile ~/.ssh/name.key

Now to connect to the server on console write:

ssh hostname

Then the console will ask you the passphrase that was set in the fourth step when we create the key on the beginning of the post