How to log in to my SiteGround shared account via SSH?

How to log in to my SiteGround shared account via SSH using PuTTY

How to log in to my SiteGround shared account via SSH using PuTTY?

SiteGround uses key-based SSH authentication instead of plain username & password. The SSH port on SiteGround’s servers is also 18765 instead of the default port 22.

In order to connect to your shared hosting account via SSH using PuTTY you will need download and install PuTTY, Pageant and Puttygen from this link.

Once you complete the software installation you will need to generate an SSH key pair from your cPanel -> SSH/Shell access -> Generate new SSH key pair section.

NB: If you are using Puttygen 0.70, note that it does not accept passphrases containing special characters such as “&”, “[“, “]”, “{“, “}”.

Fill the required fields and press Generate. Then from the section “Manage current keys” at the bottom click on the Private Key button next to the newly created entry in the table. Copy all the content including the BEGIN and END lines to a new file called private_key.ppk on your computer.

After you install them launch puttygen.exe and navigate to File -> Load Private Key, browse for your private key, open it and enter the passphrase. The passphrase was specified during the generation of the SSH key pair in cPanel.

If everything was done correctly you will receive a message saying Successfully imported foreign key. Click on the Save private key button and choose the (*.ppk) format for the file.

Right click the private key file and choose “Load in Pageant”. Alternatively you can open pageant.exe and load your private key in it. You may be prompted for the passphrase of your key.

Start putty.exe and enter the following connection details in the Sessions category:

  • Host name – enter the host/IP of the server to which you wish to connect (e.g. siteground300.com)
  • Port – the port for the connection – use 18765
  • Protocol – SSH

Press Open to establish the connection. You will be prompted for a Username which is the same as your cPanel username.

Your cPanel username, server hostname, and the IP address of your hosting account are all available in your User Area -> My Accounts -> Information & Settings (under the hosting account you will be connecting to).

How to log in to my SiteGround shared account via SSH using Linux?

How to generate an SSH key pair in Linux?

How-to-log-in-to-my-SiteGround-shared-account-via-SSH-using-linux

SiteGround uses key-based authentication for SSH. This has proven more secure over standard username/password authentication. More information on SSH keys can be found here.

You can generate an SSH key pair directly in cPanel, or you can generate the keys yourself and just upload the public one in cPanel to use with your hosting account.

When generating SSH keys yourself under Linux, you can use the ssh-keygen command. To do so follow these steps:

Open up the Terminal
Type in the following command:

ssh-keygen -t rsa

Next you will have to type in the location of the file where you would like to save the private key.

Enter file in which to save the key (/home/youruser/.ssh/id_rsa):

The public key will be saved in the same location, under the same file name, but with the .pub extension. Type in nothing to use the default location, which is /home/youruser/.ssh/id_rsa.

Finally you will have to type in a password. This will be the password required to load the private key and use it to connect via SSH later on:

Enter passphrase (empty for no passphrase):

The entire key pair generation process would look like this:

user@localhost: ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/youruser/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
16:8e:e8:f2:1d:c9:b9:cf:43:9a:b3:3c:c1:1f:95:93 user@localhost

This will create a private key written to /home/youruser/.ssh/id_rsa and a public key written to

/home/youruser/.ssh/id_rsa.pub.

To use the keys with your SiteGround account, you need to upload the public key in cPanel, under SSH/Shell access. The private key needs to be loaded in your Terminal using the ssh-add command:

ssh-add /home/youruser/.ssh/id_rsa

After which you will be asked to enter the passphrase of your key.

 ssh [email protected] -p 18765
4.7/5 - (3 votes)