I'd like to connect my hosting's cPanel to a private repository in GitHub.
I've tried to do so using 5 simple steps but it doesn't work, can you kindly assist?

I have:

  1. Created a cPanel key:
    Manage SSH Keys
  2. Authorized and View/Downloaded it:
    authorized + view/download

    View or Download
  3. Opened the GitHub private repository's setting, pasted the copied key into Deploy Keys (including write access) and hit Add Key (likewise in BitBucket's Access Keys):
    Deploy Keys
  4. Opened the GitHub private repository's homepage, clicked Code, chose SSH and copied the result (likewise with BitBucket's Clone button):
    Code SSH
  5. Went back to cPanel's Git Version Control, pasted the URL into Clone URL...and got an error:

Error: (XID bvp8gj) “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: Warning: Permanently added 'github.com,[IP Address]' (ECDSA) to the list of known hosts. [email protected]: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Code SSH fails

1 Answer 1


Turns out it's all about step 1:

  1. It cannot be done via UI since it must not have a password/passphrase, as confirmed by GitHub and by cPanel.
  2. It must not be named anything other than the default id_rsa/id_rsa.pub (also see here). The thing is cPanel does point to using Terminal for this...only to give incorrect instructions to rename it, which fails the whole process.

In other words, step 1 must be:

  1. Open cPanel's Terminal and type ssh-keygen -t rsa -b 4096. cPanel Terminal with ssh-keygen

Note it's not just removing -f filename, but there's also no need for -C "[email protected]" since the Terminal way adds it automatically anyway.

The rest of the steps remain the same.

Of course, this limitation of only 1 single filename for the entire GitHub means you can't use Deploy Keys to connect to more than one private repository.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.