Deploy key "Key is already in use"

Steps to reproduce the issue. (I have tried with several repositories.)

  1. Have an account with more than one repository.
  2. Visit repository 1 -> settings -> deploy key and create new deploy Key with “KEY 1”
  3. Visit repository 2 -> settings -> deploy key and try to add “KEY 1” as new deploy key to “repository 2” . User will see “Key is already in use” error message.

I believe it should no check for uniqueness of deploy key across all repositories!

Hi @maks-us! :wave: Welcome to the Community!

This is intended behavior! Deploy keys are intentionally limited to working on a single repository:

If you need something that works like a deploy key across multiple repos, the answer is to use a “machine user” which is detailed further down that page:

1 Like

In the docu they have -->

,Cons: Deploy keys only grant access to a single repository. More complex projects may have many repositories to pull to the same server.’’

–> Yes usually you have more than one repo, and yes it is a very bad if you cant use the same key for the all the repos. So why do github forbid to use the same key for several repos ?
We are talking about private/public keys not about passwords … so why is ,This is intended behavior!’’

For me, this seems to be a conceptional bug.