Home > Enterprise >  How to clone/push private repo on github?
How to clone/push private repo on github?

Time:11-22

I have created a private repo on github, I want to clone this (empty) repo to my local computer to push changes to.

I'm using MacOS Ventura 13.0.

I have created a keypair and I have uploaded the public key to Settings > SSH and GPG keys. I have added this key to the ssh-agent. When I test my SSH connection to GitHub, everything works as expected (I get the preferred output like my username and stuff).

When I try to clone the private repo, I get the following output:

user@my-mac <folder> % git clone [email protected]:<username>/<repo>.git
Cloning into '<folder>'...
[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.

What could possibly be wrong? Should I add the SSH key to a specific repo (in deploy keys)?

CodePudding user response:

GitHub has a page for this error message: Permission denied (publickey)

Walking through the steps listed there probably will fix your problem.

CodePudding user response:

If you have MacOS Ventura, you must

  • (easy way) to forgot about RSA signatures using SHA-1 and use another stronger type, because

Starting with OpenSSH v8.8, RSA signatures using SHA-1 are disabled

  • (hard way) RSA signatures using SHA-1 can be re-enabled, if you can edit /etc/ssh/sshd_config and do some other tricks, as it was already outlined some tome ago
  • Related