on a server, I want to have several git repositories. I want different users (=different SSH keys) to have access to different repositories (think of GitHub).
I know I can add a user's SSH key to authorized_keys
on the server. But that would give the user access to all repos.
How can I set this up correctly? How does GitHub do it?
The easiest solution is to install a tool for managing remote access to git repositories, such as:
If you're not willing to use any of those options, you can hack something together by binding keys in your authorized_keys
file to a specific command (using the command=
option) that is a wrapper that validates repository access. This answer has some ideas that might help you get started.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With