I have a private git server with one user git
and ssh key authentication. Currently, I am the only one using it, but I want to add more people and I want everyone to use user git
to connect to the server and perform git clone
, git push
, etc. If all the repositories are "public", then I know how to solve this. But for example I want to have a private repository, that I will still clone via git clone git@server:repo
with my SSH key, however I do not want other users to be able to clone it using their SSH keys.
I checked git-scm documentation on setting up the server (which was helpful for public repositories), and this post, however this post seems to only solve the problem for only private repositories.
TLDR: When you clone a repository on GitHub, you say git clone git@github.com:user/repo
and your git username and ssh key are being sent over. Now, depending on whether you have the permissions to this repository, you can clone it, otherwise not. So basically, everyone is using git
user on the surface, but under the hood some authorisation is taking place. How does GitHub handle this for example?