People who have spent enough time in IT environments must be well-versed with the term- SSH. However, if you have come across the term for the first time and wondering what SSH keys are about, you have landed on the right page.
Let us tell you more about what SSH keys are and how you can generate, activate and use SSH keys using cPanel.
SSH (Secure Shell) keys are an access credential that is used in the SSH protocol.
These keys add an additional layer of security, allowing you to log in to your server without needing a password. Unlike username and password combination, RSA key pairs make your connection more secure and less prone to hackers. The keys use mathematical formulas that are impossible to decode on even todays super computers and thus add a strong layer of security around access to your web server and files stored there.
SSH key authentication is done with two keys – private keys that stay with the user and public keys that are installed on the web hosting server. Data sent is encrypted using public keys and can only be decrypted by the user with private keys that are stored in the computer.
In addition, to safe guard your private key from being used by someone untoward, you can add a passphrase to your private key and enhance the level of security on your server even more.
Now that you have understood what SSH keys are, here’s a step-by-step guide to teach you how to generate a private/public key pair with cPanel and use the same to log in to your hosting account.
WHAT YOU REQUIRE?
- A domain name
- A web hosting account that supports cPanel
- cPanel username and password
STEP1: Log to your cPanel Account
You need to type the primary domain name which is associated with your hosting account, followed by ‘/cPanel’. For instance, if your domain name is ‘www.example.com’, type it in your browser as shown below;
After that, enter your cPanel username and password to log in to your account
STEP2: Search for SSH on the search box
Type ‘SSH’ in the search box. Click on the ‘SSH Access’.
Click on “Manage SSH Keys” on the next screen.
STEP3: Generate a New Key
Click on “Generate a New Key” under Manage SSH Keys
In addition, you have to enter an RSA ‘Key Name’ and password (passphrase).
Complete the details, click on the ‘Generate Key’.
Your keys will be successfully generated and saved under the ‘/home/<your_account_username>/.ssh directory.
Click on the ‘Go Back’ button
STEP4: AUTHORISING THE PUBLIC KEY
Now you are back on the “Manage Keys” page. Scroll down and locate the public key you have generated above under ‘Public Keys’, then click on ‘Manage’.
To activate the key on the next screen, click ‘Authorise’.
Then click on ‘Go Back’
STEP5: DOWNLOADING YOUR PRIVATE KEY
Find your private key under ‘Private Keys’ list when you are back on ‘Manage Keys’ page as you are being sent back to the page. Don’t forget, the public key is left on the sever and the private key is kept on your local computer. So, you need to download the private key by clicking on the View / Download link together with private key.
You will see your private key on the next screen. Now, you need to enter a passphrase that you entered when created the key to convert it to ‘. ppk’ format.
You are all ready to use your private key. Download the private key by clicking on the ‘Download’ button which is located at the bottom of the screen.
STEP6: TESTING THE SSH
Generally, you will be managing your website through an FTP software. Now, you can use the private key that you have downloaded above together with your FTP username to log in to your web hosting server.
Besides, private/public keys use SFTP protocol.
Select this from your FTP software.
After that, choose the login type as ‘Key File’ and use the ‘Browse’ button to locate your private key.
Later, click on the ‘Connect’ button
In case, you cannot go further due to connection problem, confirm from your hosting provider if they have changed the default SFTP ports for your server.
To sum up
With the help of this guide, you can now generate, activate and use SSH keys to access your web hosting account with cPanel.
If you are looking for a solution to secure your web hosting from any malware or hackers, the experts at Amaze can help.
Moreover, if you want to know more about SSH keys, we are just a call away. Our experts can give you detailed insights into SSH keys and how they work, while addressing your queries and doubts.