简体   繁体   中英

Git “server”, manage access via SSH keys

It was unexpectedly easy to set up a remote repository on my VPS. I want to give some people read access , some other people read and write access to one or multiple repositories. And they should all connect via the git user, like on GitHub or BitBucket.

How can you specify the access permissions, not bound to the system's users but to the SSH key they are using? For instance, everyone can read from a public repository on GitHub, but not necessarily write. Though they all would clone it via git clone git@github.com:YourName/repo_name.git . So it can't be managed via Unix user/group/world permissions.

Also, SSH shell access is disabled.

$ ssh git@github.com
Hi YourName! You've successfully authenticated, but GitHub does not provide shell access.

How can I reproduce this "behaviour" on my VPS?

You can reproduce (with even a greater degree of control) with and authorization layer like gitolite .

It is a perl script made to work with ssh and ssh key, allowing you to define groups (of people and of repos), and putting access control levels with those groups.

See " How do programs like gitolite work? ".

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