0

I use deploy key on my repos without any problem... now i want to create deploy key for a repo that belongs to an organization (that I'm a member of), i did it the usual way:

  • generate new ssh key:
    ssh-keygen -t ed25519 -C "test@example.com"
  • adding SSH key to the ssh-agent
    ssh-add ~/.ssh/key_file
  • add (public key) to the repo deploy keys (github).

but when I try to clone the repo:
git clone git@github.com:org_name/repo_name.git
I get this error message:
"ERROR: Repository not found.
fatal: Could not read from remote repository."

I tried changing the key multiple times without luck.
not sure what is happening, any help will be appreciated.

Vamp808
  • 51
  • 1
  • 7

2 Answers2

1

If your key filename is not a default one, I would recommend a ~/.ssh/config file to reference it:

Host ghdeploy
  Hostname github.com
  User git
  IdentityFile ~/.ssh/key_file

That way, you can:

  • check if you are correctly authenticated (ssh -Tv gh)
  • clone using that new configuration: git clone gh:org_name/repo_name.git
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Try to see if the key is in another repo as a "deploy key" I had done this and was getting the exact same errors..... I made my "id_rsa" as the deploy key on a repo which then disables it from every other repo that you have:

https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey

Justin K.
  • 1
  • 1