Hulp nodig? Wij helpen graag

How to login to SSH with SSH keys?

To login in SSH with SSH keys, it’s important to first make sure you’ve download your own private key and your public key is added to your hosting account. In this article we’ll explain how to add your public key to your hosting account and how to login using the Terminal Application (Linux and Mac OSX) and PuTTY (Windows).

Create a authorized_keys file on your hosting account

First things first! We need to make sure your public key is added to your hosting account. To do this, you need to create an authorized_keys file on your hosting account. This can be easily done through the File Manager option in cPanel or by simply logging into SSH and creating it with nano or vi(m). Create the file in your .ssh folder (located in the root of your webspace) and insert the contents of your public key into the file. After you’ve done that, you can proceed to using an SSH client to log in.

Login to SSH with Terminal

Use the following command to add your private key to your SSH-agent:

ssh-add

Fill in the passphrase of your SSH key pair and press ENTER. You should now see that your identity is added:

ssh-add
Enter passphrase for /Users/neostrada/.ssh/id_rsa:
Identity added: /Users/neostrada/.ssh/id_rsa (/Users/neostrada/.ssh/id_rsa)

Connect to SSH with this command:

ssh username@hostname -p 4000

Make sure you change username to your cPanel username and hostname to the name of the hosting account you wish to connect to. Enter yes when asked about your fingerprint and press ENTER. Hurray! You should now be logged into your webspace while using your SSH key pair.

Login to SSH with PuTTY

To use PuTTY with your own private key, you have to following the next steps:

Step 1. Open PuTTY.

Step 2. Go to Connection > SSH >Auth

Step 3. Click Browse and select your private key. Fill in your passphrase.

Step 4. Go to Session and fill in the required information:

  • Host Name: Fill in the name of your hosting account

  • Port: Use port 4000

Step 5. Click Open.

Step 6. Fill in your username (cPanel username)

Step 7. Hurray! You should now be logged into your webspace while using your SSH key pair.

 

This knowledgebase article was last updated on: 6 November 2018

Heeft dit artikel je geholpen?

Status

Ga naar onze statuspagina voor een overzicht van recente storingen en onderhoud.

Openingstijden

Maandag — vrijdag 9:00 — 17:00