There was a problem loading the comments.

How to Use SSH Keys in cPanel ?

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

SSH (Secure Shell) is a secure protocol that allows encrypted file transfers and remote logins over the internet. When using SSH, all communications — including login credentials and commands — are encrypted, making it a safe and efficient way to manage your server.

In cPanel, you can easily generate, import, and manage SSH keys for passwordless authentication and improved security.


🔐 Why Use SSH Keys?

SSH keys offer a more secure alternative to password-based logins. Instead of typing your password every time, you authenticate using a private key stored on your local machine and a public key installed on the server.

Because the private key is never sent over the internet and cannot be easily guessed, SSH key authentication is highly resistant to brute-force attacks.


🛠️ How to Generate SSH Keys in cPanel

  1. Log in to your cPanel account.

  2. Navigate to the Security section.

  3. Click Manage SSH Keys.

  4. Under Generate a New Key, click Generate a New Key.

  5. Enter a key name (optional), choose a key password (recommended), and select the key type and size (defaults are fine for most users).

  6. Click Generate Key to complete the process.

Your public and private key pair will be created. The public key is stored on the server; the private key remains securely on your computer.


🔁 How SSH Key Authentication Works

SSH key authentication works like a lock-and-key mechanism:

  • The public key is installed on the server.

  • The private key stays on your computer.

When you attempt to connect, the server checks if your private key matches the authorized public key. If they match, access is granted — no need to enter a password.


📥 Importing and Managing Keys

  • Import Existing Keys:
    If you already have a public/private key pair, click Import Key in the SSH Keys section to upload them.

  • Use with PuTTY (Windows users):
    If you use PuTTY as your SSH client:

    • Convert the private key to .ppk format using PuTTYgen.

    • You can download your private key from cPanel and import it into PuTTYgen.

    • Alternatively, in cPanel, under your private key, click View/Download to get the .ppk version directly.

  • Manage/Delete Keys:
    In the SSH Keys interface, you can authorize, deauthorize, or delete keys as needed for better access control.


💡 Tip

For enhanced automation and security, use SSH key authentication instead of passwords — especially for routine tasks, file transfers, or remote access via scripts.




Share via
Did you find this article useful?  

Related Articles

Tags

© Softsys Hosting