How to connect to Hostgator Server via SSH

Welcome to my website. I have a hostgator account for my website hosting and domains. I mainly never use SSH to connect to my Hostgator hosting server. But recently, I have to do this because I want to perform some administrative tasks such as dump the MySQL databases and move the website host to another server outside Hostgator. This tutorial will show you how to connect to Hostgator Server via SSH. 

Preparation

First, make sure you have the following information in hands

  • Access to Hostgator CPanel. Usually can be accessed through the address such as: https://gator4031.hostgator.com:2083
  • SSH client such as Putty or Termius

Steps to connect to Hostgator Server via SSH

In general, here are the steps to connect to Hostgator server via SSH. Please note that Hostgator does not support password based login. It uses public key instead.

  1. Configure SSH on Hostgator host
  2. Create new SSH key pair
  3. Download SSH keypair
  4. Connect via SSH

Step 1. Configure SSH access to Hostgator

First, lets login to CPanel. In my case I can access it via https://gator7011.hostgator.com:2083/ 

In CPanel, scroll down to the Security section. You should see SSH access icon there

Click SSH Access and then click Manage SSH Keys

Step 2. Create new SSH keys

Now Click Generate New Keys to generate new Public Key.

Next, type the key name. This can be anything but the default is id_rsa. You can change it to anything for example: 

connect to hostgator server via ssh

Click Generate Key and in few seconds the key is ready. 

Now click Go Back to get back to the list of keys we have. As you can see, my new id_rsa_001 key has been added to the list. Please also note that there is also a private key with the same name as the public key (id_rsa_001)

Authorize the Public Key

Now we have a new public key but we cannot use it until we authorize it. Click manage button next to the new public key and then click Authorize

Step 3. Download SSH Key

Now Go Back and we will convert our Private key to .ppk format. If you are planning to connect from Linux or Windows using Putty, we recommend to convert the private key to .ppk format. Click View/Download next to our new Private Key

Now download the Private Key and save it to a secure location. Do not distribute this key unless you want other people can access to your hosting server using the key. 

Step 4. Connect using Private Key 

So now, we have a Private Key in hands and we also have authorized the Public Key pair. Now it’s time to connect to our server via SSH using Private key. Please note that currently it is not possible to connect to Hostgator server using user and password combination. So, Private key is the solution. 

From Windows using Putty

Download and Install Putty for Windows if you don’t have it yet. Open Putty and then enter the Hostgator hostname or IP address. In my case my address would be: gator7011.hostgator.com and port number is 2222.

 

Next, go to Auth and then browse the .ppk file we downloaded from hostgator Cpanel previously.

Click Open and you will need to enter your username. This is the username to access the Hostgator CPanel.

Finally, we can access Hostgator Server via SSH. 

From Linux using Terminal

If you want to connect from Linux, simply open Terminal and follow these steps

Change permission to the private key 

chmod 400 id_rsa_01.ppk

Connect using this command

ssh -i id_rsa_01.ppk gator7011.hostgator.com -p 2222

Done

Final Thoughts

Thanks for reading this How to Connect to Hostgator Server via SSH. We hope this tutorial can help you solve your problem connecting to your hostgator account via SSH. Please leave us comments and don’t forget to share this article with others. 

2 Trackbacks / Pingbacks

  1. ssh keys hostgator support - beainfo.com
  2. ssh issues hostgator support - beainfo.com

Leave a Reply

Your email address will not be published.


*