Added a deploy key to a private repo within an organization, but still can't clone the repo

Viewed 847

On a linux server, I've successfully added an ssh key using ssh-keygen, added it to the list of keys available within ssh-agent by using ssh-add ~/.ssh/my_new_private_key, and then I've added that public key into the deploy keys section within my organization's private repo. That deploy key also has write access.

However, when I go to run git clone using the SSH link, it gives me the following error:

# git clone git@github.myorg/myprivaterepo.git
Cloning into 'myprivaterepo'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What am I missing? I have followed the guide here https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys to successfully add the deploy key, but no luck with trying to clone.

1 Answers

Make sure that:

  • ssh -Tv git@github.myorg work, meaning it displays a welcome message
  • you are using a proper SSH URL, like git@github.myorg:<me>/myprivaterepo.git: note the ': after git@github.myorg.
Related