简体   繁体   中英

Make permission to the different repository in GitHub by the public key

I have two private repositories: repo-A, and repo-B. I would like to restrict the public key of the device can only read repo-A but can read/write repo-B. I tried to add the public key into repo-A->settings=>Deply Keys and didn't tick the "Allow write access". The result is as expected the device can only clone the repo-A but cannot do push. But I got the error message "Key is already in use" when I tried to add the key into repo-B->settings=>Deply Keys.

Is that possible to make permission to the different repository in GitHub by the public key? I am very new to GitHub, any help is appreciated!

GitHub allows two types of SSH keys: user keys, which are associated with a user, and deploy keys, which are associated with a repository. It sounds like you're using deploy keys, which are specific to one repository and can't be used across others. This is to tightly restrict the permissions as much as possible.

If you want to access different repositories with deploy keys, you'll need to use different deploy keys.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM