I want to generate an SSH key with only READ permissions to be used with my GitHub account is it possible? or should I create another account with only read permission?
A deploy key is an SSH key that :
- is stored on your server and grants access to a single GitHub repository.
- Often used to clone repositories during deploys or continuous integration runs.
- Deploys sometimes involve merging branches and pushing code, so deploy keys have always allowed both read and write access.
- But Because write access is undesirable in many cases, you can have the ability to create deploy keys with read-only access.
- New deploy keys created through GitHub.com will be read-only by default and can be given write access by selecting
Allow write accessduring creation.
Creating Read only deploy key
- Go to
Settingstab inside the repository you want to give read only permission.
- On the left side navigation bar Select
- Click Add Deploy Key .
- Give it a title whatever you want and Add the ssh key.
- Make sure that box
Allow write accessis unchecked.
- You're done !
Feel free to add-in more details.
Github organizations can "sort of" support this work-flow:
- Create an organization
- Create a dummy account which will be used for readonly access
- Add the dummy account to the organization with read-only permissions
- Add whatever SSH keys you want to have on the read-only account
- Use your normal account(s) to allow writing