generating SSH Keys Print

  • 2

To generate an SSH key in cPanel and connect it to your GitHub account, follow these steps:

  1. Generate SSH Key in cPanel:

    • Log in to your cPanel account provided by your web hosting service.
    • Navigate to the "SSH Access" or "SSH/Shell Access" section. This might be located under the "Security" or "Advanced" section depending on your cPanel configuration.

Then hit blue button to manage SSH keys

    • Find the option to "Manage SSH Keys" or "Generate New Key".
    • Click on "Generate Key" or similar option.
    • You might be prompted to provide a name for the key. Choose a name that will help you identify it later.
    • The key pair (public and private keys) will be generated. Make sure to copy the public key, as you'll need it for the next step.
  1. Add SSH Key to GitHub:

    • Log in to your GitHub account.
    • Go to your account settings by clicking on your profile picture in the top-right corner and selecting "Settings".
    • In the left sidebar, click on "SSH and GPG keys".
    • Click on "New SSH key" or "Add SSH key".
    • Give your key a title (for identification purposes).
    • Paste the copied public key into the "Key" field.
    • Click "Add SSH key".
  2. Test the Connection:

    • Open a terminal on your local machine.

Test the SSH connection to GitHub by running the following command:

 
ssh -T git@github.com
    • You might be prompted to confirm the authenticity of the host. Type "yes" and press Enter.
    • If everything is set up correctly, you should see a message indicating that you've successfully authenticated with GitHub.
  1. Use SSH for Git Operations:

    • When you clone a repository from GitHub, make sure to use the SSH URL. You can find this URL on the repository page by clicking on the "Code" button and selecting "SSH".
    • When pushing or pulling changes to/from GitHub, Git will use the SSH connection for authentication.

By following these steps, you should be able to generate an SSH key in cPanel and connect it to your GitHub account, allowing you to securely interact with your repositories using SSH.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution