In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
git version control gitosis installation and use is how, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this can learn, I hope you can harvest.
Gitosis is a permissions management tool under Git, which manages Git permissions through a special repository (gitosis-admin.git).
1. Install and configure gitosis on the server
(1) Obtain the installation package by
root@wz:/home/git# git clone https://github.com/res0nat0r/gitosis
(2) Installation using Python
root@wz:/home/git# python gitosis/setup.py install
(3) Remove or rename authorized_keys to authorized_keys.bak, Gitosis will manage the public key for us, add the public key again, and let Gitosis automatically control the authorized_keys file.
root@wz:/home/git/.ssh# pwd
/home/git/.ssh
(4) modify the previous git user bash login settings
vim /etc/passwd
46 git:x:1002:1002:,,,:/home/git:/bin/bash
(5) Initialize Gitosis, you need to run gitosis-init with your own public key, first copy my local public key to the server:
y@y:git$ scp /home/y/.ssh/id_rsa.pub wzh@192.168.0.143:tmp/
wzh@192.168.0.143's password:
id_rsa.pub 100% 399 0.4KB/s 00:00
y@y:git$
The server performs the following actions: Note that not under Super Admin user:
wzh@wz:/home/git$ sudo -H -u git gitosis-init
< ~/tmp/id_rsa.pub 这样该公钥的拥有者就能修改包含着 Gitosis 设置的那个 Git 仓库了。 此时目录结构如下: 同时.ssh下面会生成一个:authorized_keys文件The repositories managed by gitosis are placed under: repositories/directory
An empty repository is initialized under the repositories/directory:
Second, the client side operation gitosis
(1) Now try SSH into the server with the owner identity of the initialized Gitosis public key:
Description Gitosis recognized the user's identity, but it severed the connection because it did not run any Git commands.
(2) Clone the control repository of Gitosis locally:
Note: IP directly followed by the name of the repository, no path, gitosis-admin.git in the server under the repositories/directory.
The gitosis-admin directory structure is as follows:
The gitosis.conf file is the control file used to set users, repositories, and permissions.
The keydir directory is the place to store the public keys of all users who have access, one for each.
(3) Modify the gitosis.conf configuration file and synchronize it to the server: it operates in the same way as a normal Git repository,
After submitting to the server, check the server:
(4) If multiple people are helping to develop a repository, you need to add each of their public key files to the keydir folder and push it to the server.
The name of the file determines what is called in the gitosis.conf configuration file.
For example, refer to ProGit.
Now we add public keys for John,Josie and Jessica:
$ cp /tmp/id_rsa.john.pub keydir/john.pub
$ cp /tmp/id_rsa.josie.pub keydir/josie.pub
$ cp /tmp/id_rsa.jessica.pub keydir/jessica.pub
Then add them all to the 'mobile' team, giving them read and write access to iPhone_project:
[group mobile]
writable = iphone_project
members = scott john josie jessica
Gitosis also has simple access control features. If you want John to have read access only, you can do this:
[group mobile]
writable = iphone_project
members = scott josie jessica
[group mobile_ro]
readonly = iphone_project
members = john
John can now clone and get updates, but Gitosis won't allow him to push anything to the project.
Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.