【发布时间】:2014-02-12 22:09:39
【问题描述】:
我刚刚在 debian 上设置了一个 git + Gitolite 服务器,在我的工作站 (Windows) 上使用 puttygen 生成了一个密钥对,并在服务器上注册了第一个 pub 密钥
gitosis setup -pk firstuser.pub
然后我使用 TortoiseGit 克隆 gitolite-admin repo,使用 url : git@git.myserv.com:gitolite-admin 和 tel Tortoise 使用 firstuser.ppk 作为私钥。 在此之前它工作正常。
然后我想测试添加一个用户并在我的工作站上创建一个新的 repo。
我在 conf 文件中添加了一个部分:
repo testcreation
RW+ = seconduser
我在我的工作站上为 seconduser 生成了第二个 ssh 密钥对。只需将 seconduser.pub 放入 keydir/commit 并推送新配置即可。
配置接缝没问题,我的新用户 pub 密钥添加到服务器端 git 用户的 ~/.ssh/authorized_keys 中。
我用 Tortoise 在我的工作站上设置了一个新的仓库,添加一个新的遥控器:
name : origin
url : git@git.myserv.com:testcreation
Putty Key : seconduser.ppk
然后push创建repo
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)
为什么当我发送 senconduser 私钥时 Gitolite 将我识别为 firstuser ?这与我在同一个工作站上使用两个不同的密钥有关吗?
【问题讨论】:
-
您可以尝试使用
git@git.myserv.com/testcreation作为远程网址吗? -
好吧...致命:'git@git.myserv.com/testcreation' 似乎不是 git 存储库 =)
-
好的。我提到它是因为 '
:' 是 scp 符号,更好地与~/.ssh/config文件结合使用,以便声明另一个密钥(如 stackoverflow.com/a/20139338/6309 或 stackoverflow.com/a/19976522/6309) -
好吧,如果我们的工作站在 Linux 下运行会简单得多,但幸运的是 Windows 的 OpenSSH 和 Msysgit 可以拯救我们,可怜的 M$ 用户^^
-
我同意。我总是在 Windows 上使用 openssh,从不使用 putty。
标签: git ssh gitolite tortoisegit