On ubuntu git server set up

git server set up on Ubuntu12.04 14.04,64 bit version of the test by

 

Here we look at how to build Git server on Ubuntu. We use VMware virtual machine to install two Ubantu system, named gitServer and gitClient_01.

1, install OpenSSH and configure SSH without password

The command sudo apt-get install openssh-server, install the SSH service.

Version Control - set up git server

The command ps -e | grep ssh, see the ssh service is started.

Version Control - set up git server

Through the above command, we installed the system for the Ubantu SSH service, and configure SSH without password, first we modify the host and ip configuration file: gedit / ect / hosts

Version Control - set up git server

2, create a user git, git for managing operational service.

 Version Control - set up git server

3, configure SSH login without password

On gitClient_01, we use the command: ssh-keygen -t rsa key generation, below

 Version Control - set up git server

After the completion, in the .ssh directory, we can see id_rsa and id_rsa.pub file, id_rsa.pub is the public key, we command scp /home/git/.ssh/id_rsa.pub gitServer: / home / git will gitClient_01 the generated public key to the copy gitServer.

On gitServer we first see if there is authorized_kesys /home/git/.ssh file directory,

If not, you can create this file by touch authorized_keys.

Authorized_keys Once created, copied the contents of the public key id_rsa.pub gitClient_01 appended to authroized_keys, the note is appended to this file, you can use the command cat /home/git/id_rsa.pub>>/home/git/ .ssh / authorized_keys.

After completion of the above, we gitClient_01, you can use the command ssh gitServer can be completed without password.

 Version Control - set up git server

4, install Git

The command sudo apt-get install git-core, install git

 Version Control - set up git server

5, establish storage directory git repository.

 Version Control - set up git server

6, warehouse server initialization

Use the command git -bare init /home/git/myRep.git, initialization of the warehouse

Version Control - set up git server

7, on gitClient_01, by cloning the remote repository git clone command, developed and run on their computer.

Git clone git@gitServer:/home/git/myRep.git

 

 

Reference: https: //www.cnblogs.com/huntaiji/p/6287707.html

Guess you like

Origin www.cnblogs.com/hanrp/p/11347415.html