Configuring SSH (Secure Shell) on HostGator

One of the great things about  HostGator is that it offers SSH (Secure Shell) on its shared hosting plans.

For most users, SSH may seem unnecessary, but having access to it is extremely useful. If you are concerned about security, for example, SSH can be used along with FTP to enable secure file transfers via SFTP (secure file transfer protocol) or SCP (secure copy protocol). It also prevents unauthorized access to your server and files because all login credentials are encrypted. (Logging in also requires a person to have a private key.) But probably the most common use for SSH is the command-line interface which enables you to easily connect to your server and send commands.

Alright, so how do you set it up on HostGator?

Setting up SSH on HostGator

1. To get started, you need to request for SSH to be enabled on your account.

In the past, HostGator required a copy of a valid photoID in order to enable SSH. However, this no longer seems to be the case. And currently, there are three methods to get it setup:

  • use the handy SSH request form
  • request it by emailing HostGator support
  • open a HostGator live chat window and have an operator set it up

2. Now you will need to configure it for access.

Log into your HostGator cPanel and navigate to SSH / Shell Access under the Security heading. And just follow the instructions to 'Manage', 'Create', and 'Authorize' SSH keys.

Connecting to Your Server via SSH

HostGator provides two Java-based utilities that you can use to connect to your server. But for maximum flexibility, standalone SSH clients are more useful. For Windows users, WinSCP and PuTTY are very popular. And for Mac users, Cyberduck is a highly recommended favorite.

Troubleshooting Common SSH Connection Problems

  1. Wrong Port Number. The standard port for SSH connections is 22. However, HostGator uses port number 2222.
  2. Key Not Authorized. Be sure to authorize your key within HostGator's cPanel SSH options.
  3. Private Key Missing. Make sure that you have downloaded your private key. It is needed to help authorize your SSH session. And if you are using PuTTY, be sure to download the key in the PuTTY's ppk format.
  4. Wrong Passphrase. When you created your key, you were required to enter a password or passphrase. Be sure to remember this as it is used for authentication along with the key.
Tags: , , , ,

14 Responses to “Configuring SSH (Secure Shell) on HostGator”

  • Dennis Edell March 24, 2009 at 5:29 pm

    Very nice 1 2 3, thanks. :)

  • Xyem March 25, 2009 at 6:45 am

    I would like to use this but I do not have the icon in my cPanel. Asking HostGator via the ticket system left me with this response ( so far ):

    Hello,

    We do not have the SSH access from with cpanel enabled. You will have to use Putty. As for key authentication, this is not allowed either. At this time we only allow password authentication.

    If you need anything else just let us know.

    =-=-=-=-=-=-=-=-=-=

    NathonH
    Night Shift Support Manager
    Level 2 Systems Administrator

  • Xyem March 25, 2009 at 7:19 am

    Just got another response which confirms that the SSH icon is disabled but you can still use key authentication by creating a ~/.ssh/authorized_keys2 file with the correct information. The reply is below:

    The “SSH/Shell Access” section of cpanel is disabled, however, this should not prevent you from using shared keys. You would need to login through SSH and set this up manually, however. Directions on how to accomplish this can be found here: http://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter8.html

    • Velvet Blues March 25, 2009 at 9:12 am

      Well, that’s strange… Perhaps the server that you are on isn’t configured for this… (Or maybe you got a confused HG admin, because you should be able to generate the keys on your server and download them.)

      Either way, PuTTY isn’t too hard to set up. And it has a very easy-to-use key generator.

  • Xyem March 25, 2009 at 9:59 am

    I got this up and running without a problem once I tried the manual way. I’m on the ‘Baby Croc’ shared hosting plan if that makes any difference. I used a key I had already generated.

    Perhaps a follow-up with the ‘manual’ way might be appropriate, in case others find themselves like-wise confused?

    Cheers

  • bloggingnews01 March 28, 2009 at 12:59 am

    Yes, while it is in a shared environment SSH is the only way to go. I can download files so much faster with TAR, chmod files, insert mysql commands, etc alot faster through the prompt rather than through the control panel….

    I wouldn’t say that SSH is inherently dangerous in a web hosting environment if it is setup properly.

    But I will give hostgator a try…. If it doesn’t do what I would like I am just going to host my services somewhere else…… The reason that I am trying out hostgator is the fact that I have heard positive comments on the uptime… The last hosting company I was with (dzones.com) had alot of downtime, even though they stated that they had a 99.9% uptime, which I found hard to believe….

  • Traian13 March 28, 2009 at 5:52 am

    Thanks for the info, it is nice to know the common problems that you can encounter.

    @Xyem I also like the manual approach. Basically they give all the info you need in a normal environment.

  • Ajith Edassery March 31, 2009 at 7:19 am

    Hopefully I will move to Hostgator once my current payment period with Host Monster is over. HM is giving a lot of CPU exceeded errors even without much traffic. I am getting more and more positive reviews about HG.

    When I move, I will remember your post :P

    • Velvet Blues March 31, 2009 at 11:44 pm

      Yes, HostGator is great. I am always recommending it to others. They have a great combination of lots of features and a low affordable price. I’d say that they’re the best in shared hosting.

    • Udegbunam Chukwudi September 10, 2009 at 1:38 pm

      Here I was recommending HostMonster to my readers so as to make a few affiliate sales. Thank God I finally came around to only recommending stuff I’ve used to my readers. Hostgator’s a bit pricey but for the services you get, they are definitely worth it.

  • connor November 11, 2009 at 12:20 am

    Thanks for posting the port number, I was having trouble connecting and i was suspecting that they had some other number than the default one.

  • sem March 16, 2010 at 1:12 am

    when i try putty on port 2222 to myweb but it ask me username it is correct but after giving mypassword assess is denied are coming what i will do ?

  • Andy Eaton November 5, 2010 at 11:08 am

    thanks for the info, I use hostagtor but had a few problems and my sites went down, emailed support and they got it sorted real quick. Their support is excellent.

  • eric January 29, 2013 at 10:22 pm

    I haven’t been able to make this or any other key-pair SSH instructions work on my Hostgator VPS. I don’t get errors — I just get a password prompt, where the correct password is the normal account password.

Trackbacks

Trackback URL:

Leave a Reply

Want us to work on your project?

Contact us today for a quote. Click here to submit details regarding your project.

If you are making a general inquiry, send an email to info@velvetblues.com

Go Daddy Deal of the Week: Cheap .COM Domains! Offer expires soon!