Ubuntu build Repo Server (a): Configure Gitosis

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.