Skip to main content
← Back to Blog

Connecting to SSH on a Shared Server using a Keypair

NB: SSH access using key authentication is now available on all Centos7 shared servers. Please contact our Support team if you’re unsure whether your current shared solution supports SSH access….

By Nublue Team

Featured image for Connecting to SSH on a Shared Server using a Keypair

NB: SSH access using key authentication is now available on all Centos7 shared servers. Please contact our Support team if you’re unsure whether your current shared solution supports SSH access.

The first thing you’ll need to do is install PuTTY and PuTTYgen on your local machine. Further instructions and download links are available from PuTTY’s site here.

Now that you have the 2 applications installed, open up PuTTYgen. We’re going to use this to create a key-pair to allow you to connect to your server via SSH.

Ensure that you’ve selected the SSH-2 RSA key type and 2048 bits – these should be default settings.

Now click “Generate” and have fun moving your mouse around to generate some random content to build the key-pair.

You should now have a private and public key pair generated. For added security, you can specify a Key passphrase – a password that anyone connecting via this key will need to use. Make sure you keep note of this passphrase.

From here, click “Save private key” to save your private key to your local machine. Make sure you know where the file is stored and that you can browse to it. It can be called whatever you like, as long as you use the .ppk extension.

Next, copy the public key directly from your PuTTYgen window. This is the text that you’ll need to request that we add to the server for you, so you’ll need to contact us ([email protected]) requesting this and including the full text of the key.

We would also recommend that you save a copy of your public key to your local machine. Click “Save public key” and ensure that you save it somewhere that you can access easily if you need to.

Once we’ve confirmed that this key has been added to the server, you can then use PuTTY to connect to the server. To begin, open up PuTTY. You’ll need to specify your site name as the domain name (assuming that your site points to your Nublue hosting already. If not you should be able to use the IP of your Nublue server). You’ll also need to ensure that Port number 22 is selected and that the Connection type is set to “SSH”.

Next, select “Connection” and then “Data”. In the field for “Auto-login username” you’ll need to enter your FTP username.

If you’re not sure what your username is, you can find it in your Plesk Control Panel under the “Web Hosting Access” tool.

Select SSH, then Auth. Now you can click “Browse…” and select the private key that you saved to your machine.

Select Session again. Enter a name for your SSH session and click save. This will allow you to easily re-open the SSH connection to your server in future.

Now to open up this SSH session now (and in future), you can select the session from the list in PuTTY and click “Open”.

Upon your first connection, you’ll probably see a security warning. You can accept this warning. Following this, PuTTY should prompt you to enter the passphrase that you generated earlier for your SSH key. You should now find that you’re connected to your server via SSH. Try pwd to confirm you’re in the correct location and whoami. You should find that you’re one directory above your httpdocs directory (otherwise known as the Webroot folder) and logged in as the default FTP user for your domain.