1. Home
  2. Web hosting accounts
  3. How do I connect to my web hosting account using SSH?

How do I connect to my web hosting account using SSH?

Den här artikeln finns även på svSvenska

Via cPanel

You can always access a terminal through cPanel. Please follow these instructions to do this:

  1. Login to cPanel.
  2. Click on the icon called Terminal under the Advanced section.
    cPanel > Terminal (Advanced)
  3. A warning will appear on the next page if you have not used the terminal before. If you are comfortable using a terminal and want to go ahead, click the blue button.
    cPanel Terminal Warning
  4. You now have complete access to your account through the terminal.

Via SSH client

To connect with SSH to our servers you are required to use keys. This guide will walk you through how to create a public key which is stored on the server along with a private key that is stored on your computer.

Create a key pair

  1. Login to cPanel.
  2. Click the SSH Access icon in the Security section.
    cPanel > SSH (Security)
  3. Click on Manage SSH Keys.
    Manage SSH Keys
  4. Click on Generate a New Key.
    Generate a New Key
  5. You now need to fill out the following information:
    • Key Name: You can choose any name you wish, for example “id_rsa” which is the default name.
    • Key Password: A password for your private key. The strength has to be over 50 for the password to be accepted.
    • Reenter Password: Enter the same password again.
    • Key Type: RSA.
    • Key Size: We recommend using 4096 bit.
      Generating a Piublic Key
  6. You can now generate the key by clicking Generate Key.

If you click on Go Back you will return to the page with your SSH keys. There should now be two keys there, one public and one private.

Activating the Key

  1. On the Manage SSH keys page you need to click on Manage to the right of your public key.
    Public Key - Manage
  2. Then click on Authorize.Authorize
  3. The SSH key is now authorized to access your account, you can click Go Back to get back to the Manage SSH keys page.

Download the private key

  1. On the Manage SSH Keys page click on View/Download to the right of the private key.
  2. If you are going to use PuTTY you will have to convert your key into PuTTY-format. If you are not going to use Putty you can skip to step 4.
  3. For Putty users. In the field Enter the passphrase to unlock the "key name" key for conversion you need to enter the password for your private key which you set when you created it. Then click Convert.Enter The passphrase
  4. Click on Download Key to save the key some where on your computer.

When the private key has been saved to your computer it is important that you click Delete to remove the private key from the server.

Set up PuTTY (Windows)

If you are running Windows 8.1 or earlier you can use a program called PuTTY to connect with SSH to the server. If you don’t have PuTTY you can download it here. To set up PuTTY to use your private key you need to follow these steps:

  1. Open up PuTTY and load the session you want to edit the settings for. If you do not have any session saved since earlier you can go to next step.
  2. Click on Connection -> SSH -> Auth.
  3. Click on Browse and find the private key file you downloaded and saved from the server earlier.
  4. Go back to Session and click Save. If you do not already have a session you need to enter a name before you click Save.
  5. In the field Host Name you need to enter the name of the server you are going to connect to. You can find the host name you need to use by following this guide.
  6. Click Open to start the SSH session.
  7. If you configured everything correctly PuTTY will now ask you if you trust the server, enter yes.
  8. PuTTY should now ask for your username, you will need to type in your cPanel username. If you do not know which cPanel username you have you can follow this guide all the way to step four to find out.
  9. At last PuTTY will ask you for the password for your private key. It is the same password as you entered when you created the key pair in cPanel.
  10. You should now be logged in to your account over SSH.

Connecting with PageAnt (Windows)

PageAnt requires that you already have PuTTY installed.

PageAnt is a program that keeps track of your keys. Every time PageAnt starts you can add your key (you will have to enter the password for the key). With PageAnt running you can make connections with PuTTY without having to enter your password every time you connect to a server.

Download PageAnt from Puttys website.

When PageAnt has been installed you should get an icon (looking like a computer with a hat on) in Windows Task Bar. Right click on the icon and then click Add Key, choose the private key file which you downloaded earlier.

You also have to enter the password for your private key.

Now you should be able to connect to the server with PuTTY without having to enter your password.

Connecting with SSH in Terminal (Unix/Linux/Mac/Windows 10)

For Mac users you can find the Terminal through Finder by searching for the word “terminal”.

If you are using Windows 10 you can use Bash on Windows 10 (WSL) to get access to the SSH client.

To use the private key you downloaded earlier you can add the -i flag to the ssh command:

ssh -v -i /path/to/private_key cpanelusername@servername

If you don’t know which cPanel username you have you can follow this guide all the way to step four to find out.

If you don’t know which server name to use you can follow this guide to find out.

The key should only be readable by the user. You can run chmod 600 /path/to/key to achieve this.

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support