Enable root login over SSH for Dedicated Servers on 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. If you have root access to your Dedicated server this article will help you establish an SSH connection on your Mac OS.

Note that the IP address from which you have ordered your Dedicated Server will be automatically added in the server firewall. If you intend to establish the SSH (or WHM) connections using another IP address you should request it to be added in the firewall by our team. Access from your IP address should be allowed for the SSH port on the server. You can request this by posting a ticket from your User Area -> Support -> Report Other Technical Issues.

Now, to connect via SSH, you will need to follow the steps below:

  • First you need to generate an SSH key pair - a public key and a private key. This should be done from your Terminal on your MAC, which you can open from Applications -> Utilities -> Terminal. You can check this step-by-step guide which covers the key generation process.
  • Once you have generated your public and private SSH keys, you should add the public key through your WHM (Web Host Manager). To do so, log in to your server's WHM panel as root and go to Manage root's SSH Keys located in the Security section. Click the Import Key button. Type in a name and a passphrase for the key and paste your public key in the corresponding field. You don't have to paste your private key. Click Import to import your key.
  • Next you need to load the saved private key into your SSH-agent. To do so open up your Terminal and use the command:

You will have to substitute /Users/youruser/private_key with the location of your private key text file. You will be prompted to type in the key's password - make sure that you type the password that you've placed during the SSH key pair setup on your Mac.

  • Now, you can connect via SSH. To connect, use the following command in your Terminal:

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

USER - root
HOST_NAME (or IP address) - enter the host/IP of the dedicated server to which you wish to connect
PORT - the port for the connection - use 18765

Your server details are available in your User Area -> My Accounts -> Information & Settings (under the hosting account you will be connecting to).

For example, if your hosting server is esm9999.sgded.com you 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!