Secure Shell (SSH) is a cryptographic network protocol used to securely access and manage servers over an unsecured network. One of the primary advantages of using SSH is the ability to authenticate users via public key cryptography, providing an additional layer of security to the traditional username and password authentication.
In this article, we will guide you on how to connect to GoDaddy Shared Linux hosting using an SSH Key on Mac, Windows, and Linux (both Debian and Red Hat-based systems). We’ll walk you through the entire process step-by-step to ensure you’re able to establish a secure connection to your hosting server.
Table of Contents
- Prerequisites
- Generating an SSH Key Pair
- Mac and Linux
- Windows
- Uploading the Public Key to GoDaddy Shared Hosting
- Connecting via SSH
- Mac and Linux
- Windows
1. Prerequisites
Before we begin, ensure you have the following ready:
- A GoDaddy shared Linux hosting account.
- Access to your GoDaddy account and cPanel.
- An SSH client installed on your computer.
2. Generating an SSH Key Pair
To connect via SSH, you will need a key pair, consisting of a private key (stored on your computer) and a public key (uploaded to the server).
Mac and Linux
- Open the terminal application.
- Type the following command and press Enter:
ssh-keygen -t rsa -b 2048
- Follow the prompts to choose a file location and set a passphrase (optional).
- Two files will be created: the private key (usually id_rsa) and the public key (usually id_rsa.pub).
Windows
- Download and install the PuTTY SSH client [1].
- Run PuTTYgen, included with the PuTTY installation.
- Click the “Generate” button to create a new key pair.
- Follow the prompts to set a passphrase (optional).
- Click “Save public key” and “Save private key” to save the key pair.
3. Uploading the Public Key to GoDaddy Shared Hosting
- Log in to your GoDaddy account and go to the “My Products” page.
- Click on “Web Hosting,” then “Manage” next to your shared Linux hosting plan.
- Click on the “cPanel Admin” button to access your cPanel.
- Scroll down to the “Security” section and click on “SSH Access.”
- Click on “Manage SSH Keys,” then “Import Key.”
- Give your key pair a name (e.g., “my_ssh_key”), then copy and paste the contents of your public key file (id_rsa.pub for Mac and Linux, or the file saved from PuTTYgen for Windows) into the “Public Key” field.
- Click on “Import” to upload the public key.
- Go back to the “Manage SSH Keys” page and click “Authorize” next to your newly imported key.
4. Connecting via SSH
Mac and Linux
- Open the terminal application.
- Use the following command to connect to your server, replacing “your_username” with your cPanel username and “your_server” with your server’s IP address or domain name:
ssh -i /path/to/private_key your_username@your_server
- If prompted, enter the passphrase you set during key generation.
- You should now be connected to your server via SSH.
Windows
- Run the PuTTY SSH client.
- In the “Host Name (or IP address)” field, enter your server’s IP address or domain name.
- In the “Port” field, enter 22 (the default SSH port).
- In the left-hand menu, expand “SSH” and click on “Auth.”
- Click “Browse” and locate the private key file saved from PuTTYgen.
- Go back to the “Session” category in the left-hand menu.
- In the “Saved Sessions” field, give your session a name and click “Save” to store your settings for future connections.
- Click “Open” to initiate the connection.
- When prompted, enter your cPanel username and the passphrase you set during key generation (if applicable).
- You should now be connected to your server via SSH.
By following this comprehensive guide, you should now be able to connect to your GoDaddy Shared Linux hosting using an SSH key on Mac, Windows, and Linux systems. SSH keys offer a more secure way to access and manage your hosting server, providing an extra layer of protection over traditional password authentication.
Remember to keep your private key secure and never share it with anyone, as it serves as your digital identity when connecting to your server. If you lose your private key or suspect it has been compromised, be sure to generate a new key pair and update the public key on your server.
Happy server management!
References
[1] PuTTY: A Free SSH and Telnet Client. Retrieved from https://www.putty.org/