Web Hosting Knowledge Base Web Hosting Knowledge Base
  • Home
Get Started
Web Hosting Knowledge Base Web Hosting Knowledge Base
Get Started
Web Hosting Knowledge Base Web Hosting Knowledge Base
  • Home
loading
  1. Home
  2. cPanel control panel
  3. How to configure SSH keys using cPanel
Updated on June 22, 2024

cPanel control panel

  • Folder icon closed Folder open iconComplete Guide of log in and log out of cPanel
  • Folder icon closed Folder open iconGetting familiar with the home screen of cPanel
  • Folder icon closed Folder open iconHow to change your cPanel password
  • Folder icon closed Folder open iconHow to change the cPanel language
  • Folder icon closed Folder open iconHow to update contact information and preferences in cPanel
  • Folder icon closed Folder open iconHow to change the cPanel style
  • Folder icon closed Folder open iconHow to change cPanel AutoSSL notifications
  • Folder icon closed Folder open iconcPanel error message: "Your IP address has changed"
  • Folder icon closed Folder open iconThe complete process of User Manager in cPanel
  • Folder icon closed Folder open iconMigrate cPanel accounts from reseller hosting to shared hosting
  • Folder icon closed Folder open iconHow to manage FTP accounts in cPanel
  • Folder icon closed Folder open iconHow to manage backups using cPanel
  • Folder icon closed Folder open iconHow to use Server Rewind to restore files and databases
  • Folder icon closed Folder open iconHow to view disk usage information in cPanel
  • Folder icon closed Folder open iconUsing the cPanel Web Disk Feature
  • Folder icon closed Folder open iconHow to use Server Rewind to restore e-mail
  • Folder icon closed Folder open iconHow to use Git version control in cPanel to install and update a site
  • Folder icon closed Folder open iconHow to reset site content for a managed account
  • Folder icon closed Folder open iconHow to exclude files and directories from cPanel backups
  • Folder icon closed Folder open iconHow to manage e-mail accounts in cPanel
  • Folder icon closed Folder open iconHow to import e-mail accounts and forwarders
  • Folder icon closed Folder open iconHow to change the time zone in webmail
  • Folder icon closed Folder open iconHow to access webmail through cPanel
  • Folder icon closed Folder open iconHow to configure autoresponders in cPanel
  • Folder icon closed Folder open iconHow to import and export webmail contacts
  • Folder icon closed Folder open iconHow to manage mailing lists in cPanel
  • Folder icon closed Folder open iconAccessing webmail clients directly
  • Folder icon closed Folder open iconHow to set up e-mail forwarders
  • Folder icon closed Folder open iconHow to resolve the '550 sender verify failed' error message
  • Folder icon closed Folder open iconExceeding mailbox storage quotas
  • Folder icon closed Folder open iconHow to manage cPanel Mail Exchanger (MX) records
  • Folder icon closed Folder open iconMailing list recipients do not receive list messages
  • Folder icon closed Folder open iconHow to set up DMARC
  • Folder icon closed Folder open iconSynchronizing local clients with webmail calendars and contacts
  • Folder icon closed Folder open iconHow to stop unwanted e-mail using Spam Filters
  • Folder icon closed Folder open iconHow to configure e-mail accounts through webmail
  • Folder icon closed Folder open iconHow to manage e-mail disk usage in cPanel
  • Folder icon closed Folder open iconHow to configure a domain for Google Workspace using cPanel
  • Folder icon closed Folder open iconE-mail messages do not forward to Gmail accounts
  • Folder icon closed Folder open iconHow to filter incoming e-mail messages by IP address
  • Folder icon closed Folder open iconHow to filter unwanted e-mail (spam)
  • Folder icon closed Folder open iconHow to Enable Spam Box
  • Folder icon closed Folder open iconHow to configure e-mail filtering in cPanel
  • Folder icon closed Folder open iconHow to add a Brand Indicators for Message Identification (BIMI) record in cPanel
  • Folder icon closed Folder open iconE-mail messages do not forward to Outlook.com (Hotmail) accounts
  • Folder icon closed Folder open iconHow to manage e-mail deliverability settings in cPanel
  • Folder icon closed Folder open iconDiscontinuation of Barracuda Spam Protection
  • Folder icon closed Folder open iconHow to manage MySQL databases and users in cPanel
  • Folder icon closed Folder open iconHow to manage PostgreSQL databases and users in cPanel
  • Folder icon closed Folder open iconHow to access phpMyAdmin and phpPgAdmin in cPanel
  • Folder icon closed Folder open iconHow to configure remote MySQL access in cPanel
  • Folder icon closed Folder open iconHow to use phpMyAdmin to copy a MySQL database
  • Folder icon closed Folder open iconHow to change the MySQL collation settings in phpMyAdmin
  • Folder icon closed Folder open iconHow to optimize and repair MySQL databases using phpMyAdmin
  • Folder icon closed Folder open iconMySQL passwords do not work after upgrade
  • Folder icon closed Folder open iconHow to delete MySQL database tables using phpMyAdmin
  • Folder icon closed Folder open iconHow to use the cPanel Domains tool
  • Folder icon closed Folder open iconHow to configure redirects in cPanel
  • Folder icon closed Folder open iconAutodiscovery and autoconfiguration DNS records
  • Folder icon closed Folder open iconHow to use the DNS Zone Editor in cPanel
  • Folder icon closed Folder open iconHow to use the cPanel Site Publisher to easily build a website
  • Folder icon closed Folder open iconHow to configure subdomains in cPanel
  • Folder icon closed Folder open iconHow to use log programs in cPanel
  • Folder icon closed Folder open iconHow to view the error log in cPanel
  • Folder icon closed Folder open iconHow to configure and download raw access logs in cPanel
  • Folder icon closed Folder open iconHow to view information about visitors, bandwidth, and resource usage in cPanel
  • Folder icon closed Folder open iconHow to exclude an IP address from AWStats statistics
  • Folder icon closed Folder open iconResource limit information
  • Folder icon closed Folder open iconHow to secure a cPanel-enabled account with a Let's Encrypt SSL certificate
  • Folder icon closed Folder open iconHow to install a third-party SSL certificate with cPanel
  • Folder icon closed Folder open iconHow to install a self-signed SSL certificate in cPanel
  • Folder icon closed Folder open iconHow to configure SSH keys using cPanel
  • Folder icon closed Folder open iconHow to use the IP Blocker in cPanel
  • Folder icon closed Folder open iconHow to configure directory privacy in cPanel
  • Folder icon closed Folder open iconHow to configure leech protection in cPanel
  • Folder icon closed Folder open iconHow to configure hotlink protection in cPanel
  • Folder icon closed Folder open iconHow to manage GnuPG keys in cPanel
  • Folder icon closed Folder open iconHow to secure a cPanel-enabled account with a cPanel SSL certificate
  • Folder icon closed Folder open iconHow to set up AutoSSL on your domain
  • Folder icon closed Folder open iconHow to set up two-factor authentication for cPanel
  • Folder icon closed Folder open iconHow to use Imunify360
  • Folder icon closed Folder open iconHow to manage the ModSecurity module in cPanel
  • Folder icon closed Folder open iconHow to set up cron jobs in cPanel
  • Folder icon closed Folder open iconHow to configure custom Apache handlers in cPanel
  • Folder icon closed Folder open iconHow to create custom error pages in cPanel
  • Folder icon closed Folder open iconHow to configure custom MIME types in cPanel
  • Folder icon closed Folder open iconHow to configure directory indexes in cPanel
  • Folder icon closed Folder open iconHow to install PHP PEAR packages using cPanel
  • Folder icon closed Folder open iconHow to install Perl modules using cPanel
  • Folder icon closed Folder open iconHow to change PHP versions and settings using PHP Selector
  • Folder icon closed Folder open iconHow to use the Python Selector in cPanel
  • Folder icon closed Folder open iconHow to change PHP versions and settings using MultiPHP
  • Folder icon closed Folder open iconHow to use the cPanel Optimize Website feature
  • Folder icon closed Folder open iconHow to create a Node.js application with cPanel using the Node.js Selector
  • Folder icon closed Folder open iconHow to migrate an existing Node.js application to Node.js Selector
  • Folder icon closed Folder open iconHow to use the Application Manager to deploy applications with Passenger
  • Folder icon closed Folder open iconHow to install WordPress using the cPanel WordPress Toolkit
  • Folder icon closed Folder open iconHow to manage WordPress using the cPanel WordPress Toolkit
  • Folder icon closed Folder open iconHow to manage plugins using the cPanel WordPress Toolkit
  • Folder icon closed Folder open iconHow to manage themes using the cPanel WordPress Toolkit
  • Folder icon closed Folder open iconHow to manage multiple sites using the cPanel WordPress Toolkit
  • Folder icon closed Folder open iconHow to stage WordPress with the cPanel WordPress Toolkit
  • Folder icon closed Folder open iconHow to manage WordPress from the command line with the cPanel WordPress Toolkit
  • Folder icon closed Folder open iconHow to configure Web Disk accounts
  • Folder icon closed Folder open iconHow to access Web Disks on Linux and BSD operating systems
  • Folder icon closed Folder open iconHow to access Web Disks on Microsoft operating systems
  • Folder icon closed Folder open iconHow to access Web Disks on Apple operating systems
  • Folder icon closed Folder open iconGetting started with cPanel
    • dfdf
  • Folder icon closed Folder open iconUsing cPanel File Features
    • Using the cPanel File Manager
    • How to restore files, email, and databases using JetBackup
  • Folder icon closed Folder open iconUsing cPanel Mail Features
    • How to forward incoming e-mail messages to a script file
  • Folder icon closed Folder open iconUsing Database Features in cPanel
    • Remote access for MySQL TCP/IP connections on cPanel
  • Folder icon closed Folder open iconUsing the Domain Features in cPanel
  • Folder icon closed Folder open iconUsing the Logging Features in cPanel
  • Folder icon closed Folder open iconSecurity Features in cPanel
    • How to use Imunify Email
  • Folder icon closed Folder open iconAdvanced Features in cPanel
    • How to use Virus Scanner in cPanel
  • Folder icon closed Folder open iconcPanel Software
    • Node.js application error message: "Cannot GET" URL
    • How to migrate an existing application from Node.js Selector to a manual installation
    • How to migrate a Next.js application to the Node.js Selector in cPanel
  • Folder icon closed Folder open iconWordPress Toolkit
    • WordPress Toolkit for resellers
  • Folder icon closed Folder open iconGranting limited cPanel account access to a developer
  • Folder icon closed Folder open iconUsing the Manage Team feature in cPanel

How to configure SSH keys using cPanel

Estimated reading: 13 minutes 188 views

This article describes how to create and deploy SSH keys using cPanel. With SSH keys, you can automate logins to your Hostvento Hosting account, or use two-factor authentication for increased security.

This article describes how to configure SSH keys using cPanel. If your hosting account does not include cPanel, or if you want to use the command line to configure SSH keys, please see this article.Table of Contents

Using SSH keys

Configuring SSH keys in cPanel

Option #1: Generating a new key

Option #2: Importing an existing key

Connecting to your account using the SSH keys

Windows operating systems

Using PuTTY

Using the native Windows SSH client

Mac OS X and Linux operating systems

Using SSH keys

When you log in to your account interactively using an SSH client as described in this article, you must enter a password every time. But what if you want to run an automated process? Perhaps you want to automatically download a database backup at certain times to your local computer. In this scenario, you don’t want to have to manually type your SSH password every time the backup process runs.

Or what if you want to allow multiple users to transfer files securely using SFTP, as described in this article? You would need to give them your cPanel password, which would give them complete access to your account.

You can solve these problems by using SSH keys to connect to your account. SSH keys enable your computer to log in to your Hostvento Hosting account automatically without you typing a password. To use SSH keys, you must first create a public key and private key (also known as a key pair). The client’s private key stays on your local computer, while the public key resides on the Hostvento Hosting server.

Alternatively, you can also create SSH keys and protect them with a passphrase for two-factor authentication. Although this configuration does not enable automatic logins, it does provide an extra layer of security, because you must have the correct key file and know the correct passphrase to access the account.

Configuring SSH keys in cPanel

When you configure SSH keys in cPanel, you can create a new key pair, or import an existing key.

Option #1: Generating a new key

To generate a new SSH key pair for your account, follow these steps:

  1. Log in to cPanel.If you do not know how to log in to your cPanel account, please see this article.
  2. Open the SSH Access tool:
    • If you are using the Jupiter theme, on the Tools page, in the Security section, click SSH Access:
    • If you are using the Paper Lantern theme, in the Security section, click SSH Access:
      cPanel - Security - SSH Access icon
  3. On the SSH Access page, under Manage SSH Keys, click Manage SSH Keys.
  4. Click Generate a New Key.
  5. Confirm the Key Name is set to id_rsa.
  6. In the Key Password and Reenter Password text boxes, type a password for the key. Alternatively, you can click Password Generator and cPanel generates a strong password for you.
  7. Confirm the Key Type is set to RSA.
  8. Confirm the Key Size is set to 2048.
  9. Click Generate Key. cPanel generates the public and private keys and saves them in the /home/username/.ssh directory, where username represents your Hostvento Hosting account username.
  10. Click Go Back.
  11. Under Public Keys, locate the name of the key you just created. Under Actions, click Manage.
  12. Click Authorize, and then click Go Back. To connect to your account using the new key, read Connecting to your account using the SSH keys below.
Option #2: Importing an existing key

If you have already generated SSH keys for your account and want to re-use them, you can use cPanel to import them. To do this, follow these steps:

  1. Log in to cPanel.If you do not know how to log in to your cPanel account, please see this article.
  2. Open the SSH Access tool:
    • If you are using the Jupiter theme, on the Tools page, in the Security section, click SSH Access:
    • If you are using the Paper Lantern theme, in the Security section, click SSH Access:
      cPanel - Security - SSH Access icon
  3. On the SSH Access page, under Manage SSH Keys, click Manage SSH Keys.
  4. Click Import Key.
  5. In the Choose a name for this key (defaults to id_dsa) text box, type the name for the key.
    If your server runs OpenSSH version 7 or later, for security reasons you cannot use DSA keys. (To determine the OpenSSH version installed on your server, type ssh -V at the command prompt.) You should use RSA keys instead.
  6. Under Paste the public key into the following text box, paste the text of the public key into the text box.
  7. Click Import. cPanel imports the key.
  8. Click Back to Manage Keys.
  9. Under Public Keys, locate the name of the key you just imported. Under Actions, click Manage.
  10. Click Authorize, and then click Go Back. To connect to your account using the new key, read Connecting to your account using the SSH keys below.

Connecting to your account using the SSH keys

Use the appropriate procedure below for your computer’s operating system.

Windows operating systems

For computers running Microsoft Windows, you can use the PuTTY program to connect to your Hostvento Hosting account with SSH keys. Alternatively, Windows 10 includes a native SSH client that you can use, without the need to install and configure an additional program.

Using PuTTY

Before you can connect to your account, you must deploy the private key to your local computer (unless you imported a public key into cPanel, in which case you presumably already have the private key on your computer). To do this, follow these steps:

  1. Log in to cPanel.If you do not know how to log in to your cPanel account, please see this article.
  2. Open the SSH Access tool:
    • If you are using the Jupiter theme, on the Tools page, in the Security section, click SSH Access:
    • If you are using the Paper Lantern theme, in the Security section, click SSH Access:
      cPanel - Security - SSH Access icon
  3. On the SSH Access page, under Manage SSH Keys, click Manage SSH Keys.
  4. On the SSH Access page, under Private Keys, locate the name of the key you created, and then click View/Download.
  5. Under Convert the “id_rsa” key to PPK format, click Convert. cPanel converts the key.
  6. Click Download Key, and then save the id_rsa.ppk file on your local computer. Make sure you note where the file is saved on your computer.

At this point, you have created the SSH key pair and deployed the private key to your local computer. You are now ready to configure the PuTTY client to connect to your SSH account using the private key.

The following procedure assumes that you have already downloaded and installed the PuTTY client. If you have not already done this, follow the PuTTY setup procedures in this article before proceeding.

To configure PuTTY to use your private key, follow these steps:

  1. Start PuTTY.
  2. In the Category pane, expand SSH, and then click Auth.
  3. Under Authentication Parameters, click Browse.
  4. Locate the id_rsa.ppk file that you created in the previous procedure.
  5. In the Category pane, click Session.
  6. In the Host Name (or IP address) text box, type username@example.com. Replace username with your Hostvento Hosting username, and replace example.com with your site’s domain name.
  7. In the Port text box, type 7822.The default port for SSH is 22. However, Hostvento Hosting uses a different port for security reasons.
  8. Confirm that the Connection type radio button is set to SSH.
  9. In the Saved Sessions text box, type a name for the connection. For example, type Hostvento account.
  10. Click Save.
  11. To connect to your SSH account, double-click the connection name in the list. PuTTY should connect without asking you to type your account password. If you set a passphrase for the key, however, you must type the key passphrase.
Using the native Windows SSH client

To use the built-in Windows 10 SSH client to connect to your account using a key, follow these steps:

  1. Log in to cPanel.If you do not know how to log in to your cPanel account, please see this article.
  2. Open the SSH Access tool:
    • If you are using the Jupiter theme, on the Tools page, in the Security section, click SSH Access:
    • If you are using the Paper Lantern theme, in the Security section, click SSH Access:
      cPanel - Security - SSH Access icon
  3. On the SSH Access page, under Manage SSH Keys, click Manage SSH Keys.
  4. On the SSH Access page, under Private Keys, locate the name of the key you created, and then click View/Download.
  5. Click Download Key, and then save the id_rsa file on your local computer. You are now ready to start the SSH client and use the key.
    Make sure you note where you save the file on your computer. To make the key file the default key file for SSH connections, save it in the \Users\username\.ssh directory, where username represents your Windows username.
  6. To open the Run dialog box, type Windows key + r.
  7. In the Run dialog box, type cmd and then click OK to open a command prompt window.
  8. At the command prompt, type the following command. Replace username with your Hostvento Hosting username, and replace example.com with your site’s domain name:
    Copyssh -p 7822 username@example.comIf you did not save the key file in the \Users\username\.ssh directory in step 5, you must also specify the key file location. To do this, type the following command instead. Replace path with the path where you saved the key file in step 5:Copyssh -p 7822 -i path username@example.com
  9. If this is the first time you are connecting to the server, you receive a message about the key fingerprint. Type yes and then press Enter.
    You do not receive this message on subsequent connection attempts.
  10. When you are connected, the remote server’s command line prompt appears:
    Copyusername@hostname [~]#
  11. You can now run commands on the remote server. For example, to see a listing of the current directory, type ls and then press Enter.
  12. To close the SSH connection when you are done, type exit and then press Enter.
  13. To close the command prompt window, type exit and then press Enter.
Mac OS X and Linux operating systems

Before you can connect to your account, you must deploy the private key to your local computer (unless you imported a public key into cPanel, in which case you presumably already have the private key on your computer). To do this, follow these steps:

  1. Log in to cPanel.If you do not know how to log in to your cPanel account, please see this article.
  2. Open the SSH Access tool:
    • If you are using the Jupiter theme, on the Tools page, in the Security section, click SSH Access:
    • If you are using the Paper Lantern theme, in the Security section, click SSH Access:
      cPanel - Security - SSH Access icon
  3. On the SSH Access page, under Manage SSH Keys, click Manage SSH Keys.
  4. On the SSH Access page, under Private Keys, locate the name of the key you created, and then click View/Download.
  5. Click Download Key, and then save the id_rsa file on your local computer in the /home/username/.ssh directory. Replace username with your own username.

At this point, you have created the SSH key pair and deployed the private key to your local computer. You are now ready to connect to your SSH account using the keys.

To connect to your SSH account using the keys, follow these steps:

  1. Open a terminal window. The procedure to do this depends on the operating system and desktop environment.
    • On Mac OS X, click Applications, click Utilities, and then click Terminal.
  2. At the command prompt, type the following command. Replace username with your Hostvento Hosting username, and replace example.com with your site’s domain name:Copyssh -p 7822 username@example.comIn this command, we explicitly specify the port number, the username, and the hostname. However, you can also define the settings for a remote host in your ~/.ssh/config file as follows:Host example Hostname example.com Port 7822 User username The Host value can be any name you want; it is simply a label for the other settings. The Hostname value is the remote host you want to access, the port number is 7822, and the User value specifies your Hostvento Hosting account username. With this configuration defined, you can connect to the account by simply using the Host value. You do not have to type the port number, username, and hostname each time. The following command demonstrates how to do this:Copyssh example
  3. The SSH client should connect without asking you to type your account password. If you set a passphrase for the key, however, you must type the key passphrase.If you are using a passphrase, you may not want to have to re-type it every time you connect to the remote server. If your computer has OpenSSH version 7.2 or later, you can automatically store the passphrase in the SSH authentication agent. (To determine the OpenSSH version installed on your computer, type ssh -V at the command prompt.) Then when you connect to the remote server, you must type the passphrase the first time, but not for any subsequent connections.
    To do this, add the following lines to your ~/.ssh/config file:Host * AddKeysToAgent yesIf you are using Mac OS X, add the following line as well: UseKeychain yesAlternatively, if you have an older version of OpenSSH installed on your computer, you can type the ssh-add command to manually store the passphrase in the SSH authentication agent for the duration of your login session.If your computer has OpenSSH version 8.8 or later, you may be unable to connect to the server. (To determine the OpenSSH version installed on your computer, type ssh -V at the command prompt.) This is because by default, OpenSSH 8.8 and later versions disable RSA signatures using the SHA-1 hash algorithm.
    To enable RSA signatures with SHA-1 hashes so you can connect to the server, add the following lines to your ~/.ssh/config file:HostKeyAlgorithms +ssh-rsa,ssh-dss PubkeyAcceptedAlgorithms +ssh-rsa,ssh-dss

Still stuck? How can we help?

How can we help?

Was this page helpful? Yes No

Share this Doc

How to configure SSH keys using cPanel

Or copy link

Clipboard Icon
CONTENTS
Leaf Illustration

© 2023 All Rights Reserved by Hostvento