1.ssh git installation
sudo apt-get install openssh-server openssh-client git
2. Client Login
git clone ssh://shuyong@192.168.1.100/home/shuyong/project/dailyproject/ 3. Permission configuration here to demonstrate the establishment of User1 User2 Two users simulate two developers respectively,
Build git user, source code is initialized by git user, can treat it as Project Manager and change password separately
Generate Public key
Ssh-keygen-c "Your email address"-t RSA
After the direct carriage return to the end, the middle can not need any settings, the command will generate a pair of asymmetric public/private keys, the default they are stored in:
xp/2003 User: C:/Documents and settings/landing name/.ssh
Vista users: c:/users/Landing name/.ssh
Linux: ~/.ssh below for user1 user2 generate public key, private key
This will result in the/home/user1/.ssh of two files, Id_rsa private keys, and id_rsa.pub public key files
The public key looks about the same.
Under the. SSH folder, the private key is placed in the Id_rsa file, regardless of its contents;
For User2, git users do the same processing, and then their respective directories generate the corresponding files
You then need to provide the User1 user2 respective public key files to the Git user,
2. Add the public key to the Authorized_keys file of the Git user on the Linux server.
can refer to: http://github.com/git-on-windows/rookies
Git user's establishment and setting reference: http://progit.org/book/zh/ch4-4.html
Just add them to the Authorized_keys file (this example adds to the tail of the file):
So the certification is built.
Then use git user to build a library in the/home/git directory project_repos.git/
Then the shipment service/etc/init.d/git-daemon restart
And of course you have to start sshd.
/etc/init.d/sshd start
User1 connection (this test will be porject_repos.git to Repos.git, this section, can be ignored)