1. Description
Server-side ip:192.168.1.126, hereinafter referred to as: a end;
Client ip:192.168.130.19, hereinafter referred to as: Terminal B.
2. Install the necessary software (end a)
sudo apt-get install Git-core openssh-server openssh-client
3. Installation Configuration Gitosis
3.1 Downloads gitosis (end a)
mkdir ~/gitosis_setup CD ~/gitosis_setupgit clone git://eagain.net/gitosis
If it fails, use the following address:
git clone https://github.com/res0nat0r/gitosis.git
3.2 Mounting gitosis (end a)
CD Gitosissudo python setup.py install
If the Python setup.py install fails, the Python-setuptools needs to be installed:
sudo apt-get install Python-setuptools
3.3 Creating a System user for gitosis (end a)
Create a password-disabled user git:
sudo adduser--system--shell/bin/sh--gecos ' git SCM user '--group--disabled-password--home/home/git git
3.4 New and configured gitosis administrator (b-side)
It is best not to use a computer user as the administrator, this article uses the B-side gitadmin user as the Gitosis administrator.
A) generate Pub.key (b end)
SSH-KEYGEN-T RSA
Generated under/home/gitadmin/.ssh/id_rsa.pub, copy the id_rsa.pub to the-end of the TMP directory:
SCP ~/.ssh/id_rsa.pub [Email protected]:/tmp/id_rsa_gitadmin.pub
b) Execution Gitosis-init (end a)
Cd/tmpsudo chmod 777 id_rsa_gitadmin.pubsudo-h-u git gitosis-init < id_rsa_gitadmin.pub
At this point, some directories are generated under the/home/git directory, and if other users need the clone Gitosis-admin.git permissions, you need to do the following:
sudo chmod 755/home/git/repositories/gitosis-admin.git/hooks/post-update
c) Cloning Gitosis-admin.git (b end) from end a
Mkdir-p share/gittest/cd share/gittest/git Clone [email Protected]:gitosis-admin.gitcd gitosis-admin/
Where gitosis.conf is the gitosis configuration file for configuring users and permissions, keydir/is the public key for all group members.
View the gitosis.conf file with the following content:
[Gitosis] [Group gitosis-admin]members = [email protected]writable = gitosis-admin
Ubuntu build Repo Server (a): Configure Gitosis