Setting up SSH access on your shared host
Through Sasahost, an affordable web hosting company based in Kenya, I managed to get SSH access on my account. This is how I did it.
To begin with, Sasahost offers the most affordable web hosting packages I have ever come across. At ~ KES 2,000 (~ $20) per year, you get their cheapest bundle offer which comes with:
- 15GB disk space
- 150GB monthly bandwidth (more than enough for a beginner website with minimal traffic)
- A free SSL certificate (through Let’s Encrypt)
- SSH Access
- Free domain registration and subsequent renewal
You also get the usual unlimited sub domains, unlimited MySQL databases, unlimited email accounts and unlimited FTP access.
Now, I promise that this article is not sponsored by Sasahost. I just think they offer a really good deal at a very affordable price, especially for Kenyans trying to take their services online, hence deserve a shout out whenever possible.
The following tutorial assumes you’re hosting with Sasahost, and are using a Linux distro for your personal computer. I am using Ubuntu 16.04 LTS.
Let’s get started.
To get SSH access on your account, you have to personally request the team at Sasahost to enable it. I simply opened a ticket with them at around 8.45 PM, and by the next morning at 9.00 AM, I had received a response confirming SSH access enabled. Password authorization is disabled, therefore, you have to generate SSH keys via cPanel.
Now previously, I had generated SSH keys for use with my Github account. The tutorial on how to generate the keys can be found on Github Help. I am not sure how secure this is, but I decided to use the same keys for my hosting account.
Below are the steps I used to import the key to my account:
- Log into cPanel.
- Navigate to the Security section, then select SSH Access. It should be the first option available.
- The next page gives a brief description of what SSH is, and how to use SSH keys. At the bottom, click Manage SSH Keys.
- At the top of the Import SSH Key page, click Import Key.
Fill in the fields as shown below:
- Choose a name for this key (defaults to id_dsa): <If you followed the Github instructions, your key should be called id_rsa. Use this name.>
- Paste the private key into the following text box: <Leave blank>
- Passphrase: <Use the passphrase you created when following the Github instructions>
- Paste the public key into the following text box: <Paste the contents in the id_rsa.pub file located in your home directory (~/.ssh/id_rsa.pub)>
- Click Import.
Once you’ve done this, the key still needs authorization for it to work. Therefore, click on Go Back to take you back to your SSH keys.
Under Public Keys, you should be able to see the new key you just imported. Click on Manage, then Authorize.
You now have SSH access to your account. To access it through your computer, launch the terminal using the shortcut
ctrl + alt + t .
Type the following, then press enter:
ssh -p <ssh port> <username>@<host ip>
The ssh port and host ip will be sent to you via email by the support team at Sasahost. As for the username, use the username you use to log in to cPanel.
You will get a prompt asking whether to allow access & to add your ip address to known_hosts. Type
yes then press enter.
You will then get a prompt asking you to enter your passphrase. Enter the passphrase you set when generating you SSH key.
That’s it! You should now have SSH access to your shared web hosting server.
In case of any questions, requests for clarification or comments, feel free to post below or contact me via email@example.com. I’ll try to respond as soon as possible.