Knowledge Base

How to add your site with CodeGuard's public key in cPanel

Overview

By the end of this article you will have CodeGuard's public key installed and authorised on your cPanel-hosted server, allowing CodeGuard to connect to your site without a password. A public key is one half of a key pair used for Secure Shell (SSH) authentication: the server holds the public half, CodeGuard holds the matching private half, and the two together prove CodeGuard's identity without a password being sent.

The article covers four stages in order:

  • Copying the key from CodeGuard
  • Importing it into cPanel
  • Authorising it so the server will accept it
  • Completing the connection back in CodeGuard

A verify section confirms the key is working, and a troubleshooting section covers the common failures.

This procedure applies to hosting accounts that use cPanel. If your host uses a different control panel, the steps will differ, though the principle is the same.

Before you begin

  • An active CodeGuard account with the website ready to add.
  • cPanel access for the hosting account, with permission to manage SSH keys.
  • SSH access enabled on your hosting plan. Many shared hosting plans have it disabled by default. If the SSH/Shell Access panel is missing or reports that access is not available, ask your hosting provider to enable it before starting.

Step 1: Copy CodeGuard's public key

  1. In CodeGuard, begin adding your site and select Add our public key to your server.
     
    Figure 1: CodeGuard add site screen with the option to add CodeGuard's public key to your server
  2. CodeGuard displays a public Rivest–Shamir–Adleman (RSA) key. Copy the whole key exactly as shown, including its opening and closing text, and take care not to add line breaks or spaces.
      
    Figure 2: CodeGuard displaying the public RSA key to copy for installation on your server

Leave this CodeGuard page open. You will return to it in Step 4.

Step 2: Import the key into cPanel

You are now working in cPanel, not CodeGuard.

  1. In cPanel, find the Security section and select SSH/Shell Access.
     
    Figure 3: Shell Access panel
  2. Select Manage SSH Keys.
     
    Figure 4: Shell Access page with the Manage SSH Keys option
  3. Choose the option to import a key, and paste the key you copied in Step 1 into the public key field.
      
    Figure 5: Import SSH Key page with the public key field ready for pasting
  4. Give the key a name that identifies it clearly, such as id_rsa_cg. A recognisable name matters because it is how you will find this key later if you need to revoke CodeGuard's access or audit which keys are installed.
     
    Figure 6: Key naming field with a descriptive name entered for the CodeGuard key

Step 3: Authorise the key

Importing a key does not make it usable. The server ignores it until it is authorised.

Select Manage Authorization beside the key you just imported, then confirm the authorisation.
 

Figure 7: Manage Authorization option beside the imported CodeGuard key

Step 4: Complete the connection in CodeGuard

Return to the CodeGuard page you left open in Step 1 and continue adding the site. CodeGuard now connects to your server using the authorised key, without needing a password.

 
Figure 8: CodeGuard connection screen confirming the site was added using the public key

Verify the key is working

The key is installed correctly when both of the following are true:

  • In cPanel, the key appears in the SSH key list with a status of authorised.
  • In CodeGuard, the site connects successfully and its initial backup begins.

Troubleshooting

CodeGuard cannot connect after the key is authorised

The key may have been altered when pasted. Return to Step 1, copy the key again, and re-import it. A single added space or line break makes the key invalid.

The key shows as not authorised

Importing and authorising are separate actions. Return to Step 3 and select Manage Authorization for the key.

The SSH/Shell Access panel is missing from cPanel

SSH access is not enabled on your hosting plan. Ask your hosting provider to enable it.

The key was imported but CodeGuard still asks for a password

Confirm you imported the key into the same cPanel account that hosts the website you are adding. On accounts with multiple users, a key imported under one user does not apply to another.

If the problem persists, contact Sectigo Support.

Similar questions

  • How do I connect CodeGuard to my server without a password?
  • How do I add CodeGuard's SSH key in cPanel?
  • What is CodeGuard's public key and where do I find it?
  • How do I revoke CodeGuard's access to my server?

Need assistance?

Contact our team for help with your purchase or issuing your certificate.

Live chat

Call us today