Git 陆龟+;硅钙石3
我刚刚在debian上设置了一个git+Gitolite服务器,在我的工作站(Windows)上用puttygen生成了一个密钥对,并在服务器上注册了第一个pub密钥Git 陆龟+;硅钙石3,git,ssh,gitolite,tortoisegit,Git,Ssh,Gitolite,Tortoisegit,我刚刚在debian上设置了一个git+Gitolite服务器,在我的工作站(Windows)上用puttygen生成了一个密钥对,并在服务器上注册了第一个pub密钥 gitosis setup -pk firstuser.pub 然后我使用Ortoisegit克隆gitolite管理报告,使用url:git@git.myserv.com:gitolite admin和tel Tortoise将firstuser.ppk用作私钥。 在这一点之前,它运行良好 然后我想测试添加一个用户并在我的工作
gitosis setup -pk firstuser.pub
然后我使用Ortoisegit克隆gitolite管理报告,使用url:git@git.myserv.com:gitolite admin和tel Tortoise将firstuser.ppk用作私钥。
在这一点之前,它运行良好
然后我想测试添加一个用户并在我的工作站上创建一个新的repo
我在conf文件中添加了一个部分:
repo testcreation
RW+ = seconduser
我在工作站上为seconduser生成第二个ssh密钥对。只需将seconduser.pub放入keydir/commit并推送新配置
配置seam为了使其正常运行,我的新用户pub密钥添加到服务器端git用户的~/.ssh/authorized_密钥中
我用Tortoise在我的工作站上建立了一个新的回购协议,添加了一个新的遥控器:
name : origin
url : git@git.myserv.com:testcreation
Putty Key : seconduser.ppk
然后推动创建回购协议
TortoiseGit Log :
git.exe push --all --progress "origin"
FATAL: W any testcreation firstuser DENIED by fallthru
(or you mis-spelled the reponame)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git did not exit cleanly (exit code 128) (1591 ms @ 12/02/2014 12:20:17)
为什么Gitolite在发送senconduser私钥时将我标识为firstuser?这与我在同一个工作站上使用两个不同的键有关吗?我找到了解决问题的方法 请注意,我的工作站在Windows下 事实上,Ortoisegit并没有使用OpenSSH作为SSH客户端,而是使用Putty。在我的例子中,这真的很麻烦,因为带有Plink(putty)的龟甲无法处理两个私钥,从而对来自同一工作站的两个不同Gitolite用户进行身份验证user@host(在我的例子中是firstuser和seconduser)使用putty作为ssh客户端 请注意,在现实生活中,您可能不需要在同一工作站上使用2种不同的ssh身份验证,我只需要它来进行“测试” 问题是,就我所见,putty是每个注册一个密钥user@host (git@git.myserv.com),我需要两个密钥…我在
%HOMEDRIVE%%HOMEPATH%\.ssh\config
Host ssh_host_1
HostName git.myserv.com
User git
IdentityFile ~/.ssh/ssh_host_1_keyfile
这是我的配置:
Host gitfirstuser
HostName git.myserv.com
User git
IdentityFile ~/.ssh/firstuser@git.myserv.com
Host gitseconduser
HostName git.myserv.com
User git
IdentityFile ~/.ssh/seconduser@git.myserv.com
其中firstuser@git.myserv.com
和seconduser@git.myserv.com
是OpenSSH密钥格式的私钥文件
在那之后,我可以克隆testcreation.git
,使用gitbash
git clone gitseconduser:testcreation
所以推,拉,等等
但是,当您有一些GUI粉丝时,git bash只是一场噩梦,因此下面是一个用TortoiseGit实现的解决方案,它可以使用真正的ssh客户端:
打开龟甲设置:
> Network section > SSH Client input > Browse...
在msysgit安装目录中查找ssh.exe,在我的示例中:
C:\Program Files\Git\bin\ssh.exe
将ssh客户端更改为ssh.exe后,就可以充分利用ssh配置文件
例如:
在%HOMEDRIVE%%HOMEPATH%\.ssh\config中
Host ssh_host_1
HostName git.myserv.com
User git
IdentityFile ~/.ssh/ssh_host_1_keyfile
在Ortoisegit中,添加远程或克隆时,请使用以下url:
ssh_host_1:repository_name
无需查找私钥文件,openssh将根据ssh\u host\u 1
部分进行标识。好了,我找到了解决问题的方法
请注意,我的工作站在Windows下
事实上,Ortoisegit并没有使用OpenSSH作为SSH客户端,而是使用Putty。在我的例子中,这真的很麻烦,因为带有Plink(putty)的龟甲无法处理两个私钥,从而对来自同一工作站的两个不同Gitolite用户进行身份验证user@host(在我的例子中是firstuser和seconduser)使用putty作为ssh客户端
请注意,在现实生活中,您可能不需要在同一工作站上使用2种不同的ssh身份验证,我只需要它来进行“测试”
问题是,就我所见,putty是每个注册一个密钥user@host (git@git.myserv.com),我需要两个密钥…我在%HOMEDRIVE%%HOMEPATH%\.ssh\config
Host ssh_host_1
HostName git.myserv.com
User git
IdentityFile ~/.ssh/ssh_host_1_keyfile
这是我的配置:
Host gitfirstuser
HostName git.myserv.com
User git
IdentityFile ~/.ssh/firstuser@git.myserv.com
Host gitseconduser
HostName git.myserv.com
User git
IdentityFile ~/.ssh/seconduser@git.myserv.com
其中firstuser@git.myserv.com
和seconduser@git.myserv.com
是OpenSSH密钥格式的私钥文件
在那之后,我可以克隆testcreation.git
,使用gitbash
git clone gitseconduser:testcreation
所以推,拉,等等
但是,当您有一些GUI粉丝时,git bash只是一场噩梦,因此下面是一个用TortoiseGit实现的解决方案,它可以使用真正的ssh客户端:
打开龟甲设置:
> Network section > SSH Client input > Browse...
在msysgit安装目录中查找ssh.exe,在我的示例中:
C:\Program Files\Git\bin\ssh.exe
将ssh客户端更改为ssh.exe后,就可以充分利用ssh配置文件
例如:
在%HOMEDRIVE%%HOMEPATH%\.ssh\config中
Host ssh_host_1
HostName git.myserv.com
User git
IdentityFile ~/.ssh/ssh_host_1_keyfile
在Ortoisegit中,添加远程或克隆时,请使用以下url:
ssh_host_1:repository_name
无需查找私钥文件,openssh将根据ssh\u host\u 1
section进行标识,您可以尝试git@git.myserv.com/testcreation
作为远程url?嗯……致命:'git@git.myserv.com/testcreation'似乎不是git存储库=)正常。我之所以提到它,是因为“:
”是scp符号,最好与~/.ssh/config
文件结合使用,以便声明另一个密钥(如在或中),如果我们的工作站在Linux下运行会简单得多,但事实并非如此,幸运的是windows的OpenSSH和Msysgit在这里拯救了我们,可怜的M$用户^^^我同意。我总是在Windows上使用openssh,从不使用putty。你能试试git@git.myserv.com/testcreation
作为远程url?好…致命:'git@git.myserv.com/testcreation'似乎不是git存储库=)正常。我之所以提到它,是因为“:
”是scp符号,最好与~/.ssh/config
文件结合使用,以便声明另一个密钥(如在或中),如果我们的工作站在Linux下运行会简单得多,但事实并非如此,幸运的是windows的OpenSSH和Msysgit在这里拯救了我们,可怜的M$用户^^^我同意。我总是在Windows上使用openssh,从不使用putty。回答得很详细+1非常详细的回答+1.