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

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.

To connect via SSH, follow these steps:

  • First you will need to generate an SSH key pair - a public key and a private key. This can be done in cPanel -> SSH/Shell Access. The process is covered in this tutorial.
  • Next you need to copy the private key from cPanel and save it into a text file on your computer.
  • Afterwards you need to load the saved private key into your SSH-agent. To do so open up the Terminal and use the command:

You will have to substitute /Users/youruser/private_key with the location of your private key text file.

  • Next you will be prompted to type in the key's password. You get to choose the password when generating keys in cPanel.

Finally, you can connect via SSH. To connect, use the following command in the Terminal:

You will need to substitute the following variables with your account details:

USER - your cPanel username.
HOST_NAME (or IP address) - 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

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).

For example if your cPanel username is user1 and your hosting server is siteground300.com you will need to execute the following command in your Terminal:

 

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!