简体   繁体   中英

Give different permissions to different users to a git repository stored on a remote server

I have a server which will be used to store a private git repository. On this server there is a user called git .

In /opt/ there is a directory which contains the repository I have implemented.
This directory is managed by git (the group is also git).

The remote connections to this server can be done using SSH with public key authentication (no password authentication).
The public keys belong to 2 different category of users: those who have pull and push permissions on the repository and those who have only pull permissions.

What should I have to do in order to map each public key to the right permissions (pull + push or only pull)?

Ideally, gitolite is an authorization layer in which you can register those users (in a dedicated special Git repository gitolite-admin )

repo foo
    RW+     =   alice
    RW      =   carol

repo bar
    RW+     =   bob
    R       =   alice
  • R means "pull only"
  • RW means "pull or push"

The advantage is that is does not need a separate database, as opposed to the next best solution: gitea (single executable, but needing an associated database)

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