error is handled, restart the sshd service and then perform the preceding step 6th again.8) switch back to the cygwin terminal window opened as the administrator (if one is closed due to step 2) and run the following command$ chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update So far, gitosis has been successfully installed!7) Use gitosis1) Check out the
key generated on the gitclient_01 to the Gitserver.On Gitserver We first look at whether Authorized_kesys files exist under the/home/git/.ssh directory,If not, you can create this file from Touch Authorized_keys.After the Authorized_keys is created, append the contents of the public key id_rsa.pub copied on the gitclient_01 to the Authroized_keys, note that it is appended to the file, and you can use the command cat/home/
, Id_rsa.pub, is sent to the manager of the Git warehouse.
2. Erecting server
(1) Server-sideIt's a good idea to create a git group so that you can add a git user and add it to the group.
sudo adduser gitSu gitCD ~mkdir. SSH
Create a new. SSH directory for the
GoalThe thing to do, is when the file is submitted to SVN, you can re-read the server to all the content of the commit file, and according to some rules to verify the legitimacy of the file, if the validation fails, the submission is terminated, and the SVN client displays an error message.Preparatory work1, install SVN server, this example uses COLLABNETSUBVERSION-SERV
install// Git gitosis is installed on the server pc. The Administrator PC and user PC only need to install Git-core.----------------------------------------------Create a git user on the server pc----------------------------------------------Sudo adduser -- System -- shell
of known hosts.
Root@192.168.1.193's password:
Id_rsa.pub 100% 396 0.4KB/s
2. server-side settings
[Root @ wanyan ~] # Ssh-keygen // click "OK" without entering any information below
Generating public/private rsa key pair.
Enter file in which to save the key (/root/. ssh/id_rsa ):
Created directory '/root/. ssh '.
Enter passphrase (empty for no passphrase ):
Enter same passphrase again:
Your identification
Recently in writing some scripts, in order to maintain continuity, at home also time to catch up with the progress, so encountered the code synchronization problem, currently think of the method has three:
Using the cloud disk, this is used, but because the cloud disk also stores some other things, always real-time synchronization is not appropriate;Using SVN, the traditional code-hosting tool, has been in use;Using Git, the latest distribute
first entering the project root directory.
Then enter the following command
Fifth Step
To modify the owner of a generated. git file as a git user
Sixth step
The above only creates an empty warehouse and needs to add the project file. The following command is a common operation for Git and is a way to use
command line input: Git clone [email protected]***.***.**.**:/home/git/repositories/tset.git (* denotes your own IP)Follow the prompts to enter Yes, and then enter the password for the git user (i.e. the password set above)Then you can see the test directory on the client, enter this directory, modify the files in this directory, you can push the changes to the
config file under the same directory, note that there is no extensionFile enter the following contentHost Server #执行git命令时服务器别名 #HostName 192.168.1.110 #这里是你服务器的地址 #User git #登陆服务器用户名 #Identityfile ~/.SSH/PRIVATE_KEY.PPK #私钥地址 #6. Server-side create a folder with Tortoisegi
1. Install git with yum install Git-core (server)2. Create a bare repository (server)[Email protected]]$ mkdir/home//home/-bare wwwroot.git3. Give permissions (server)Chown-r Git:git Wwwroot.git4. Add git user and password (
Server-side configuration#创建用户Useradd-m git#安装gitosisApt-get Install Python-setuptools Installation Toolgit clone https://github.com/res0nat0r/gitosisCD gitosisPython setup.py InstallPlacing the public key of the client management user in any directory on the serverSudo-h-u git gitosis-init The repositories directory a
error about a DLL file (which file cannot be remembered, you can search for it in the msysigt directory based on the file name), you can copy the file to the same directory.C: \ SSH \ binAnd then it can run normally.
Category:
Version Control green channel: Follow me to add this article to favorites and contact yinner
Follow-1
Fans-0 + + + follow 00 (please comment on the article) «previous blog: how to use GitHub
Posted onYinner reading (3274)Comment (9)Edit favorites
Comment
2216068
# View th
The company code base with Git, all with SSH authentication, multiple code base multiple users, rights management is a headache problem, today finally has the empty test under Gitolite,gitolite is an authorization layer on top of git, relying on sshd or HTTPD for authentication. (Summary: Authentication is determining who the user is, and authorization is deciding whether the user is allowed to do what he
on the client, not on the server (of course, you can also operate on the server ). It is a version repository and a pure repository without a working directory. Of course, you can find gitosis. conf and keydir on the client, but do not touch the server. Otherwise, if you want to push the client administrator, an error will occur.
So, as long as you want to add a
/passwd file to find git:x:500:500:,,,:/home/git:/bin/bash This line, generally in the last line, instead of git:x : 500:500:,,,:/home/git:/usr/bin/git-shell note the numbers may be different depending on the actual situation of your computer. After the simple steps above, the GIT environment has been built.The followi
:~ wei_jingyun$ sudo chmod 755/users/wei_jingyun/repositories//gitosis-admin.git/hooks/post-updatePassword:localhost:~ wei_jingyun$ CD ~localhost:~ wei_jingyun$ CD repositories/localhost:~ wei_jingyun$ lsGitosis-admin.gitThe last step is to modify the path of the GIT account.Yourname:gitosis git$ Touch ~/.BASHRCYourname:gitosis
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.