git 克隆权限被拒绝 (gitosis)
我尝试在我的 linux-box (Debian) 上设置一个 git 存储库。我想在我的 osx Lion 上克隆 git 存储库。我安装了 gitosis,在我的计算机上创建一个 rsa 密钥 (git_rsa),将其放到服务器上,然后初始化 gitosis。 我有一个 ~/.ssh/config 文件,因为 ssh 端口不是默认端口。我也将 git_rsa 密钥添加到我的钥匙串中。 我的 ~/.ssh/config 看起来像
主机 git
HostName mydomain.com
Port 54321
Identityfile ~/.ssh/git_rsa
User git
当我尝试克隆管理存储库时,
git clone git:gitosis-admin.git
:我给出:权限被拒绝(公钥)。 fatal:远端意外挂断 问题是什么? (密钥被 chmoded 为 700,并且 ssh 可以完美地使用相同的密钥但另一个用户)
有人可以给我一个提示,我该如何解决这个问题?
提前致谢。
I try to setup a git repository on my linux-box (Debian). I want to clone the git repo on my osx Lion. I installed gitosis, create a rsa key my computer (git_rsa), put it to the server, and init gitosis.
I have a ~/.ssh/config file because the ssh port isn't the default. I added the git_rsa key to my keychain too.
My ~/.ssh/config looks like
Host git
HostName mydomain.com
Port 54321
Identityfile ~/.ssh/git_rsa
User git
when I try to clone the admin repo:
git clone git:gitosis-admin.git
I gave: Permission denied (publickey).
fatal: The remote end hung up unexpectedly
What is the problem? (The key is chmoded to 700 and ssh is work perfectly with the same key but another user)
Someone can give me a hint how can I resolve this problem?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,我尝试了 gitolite,一切正常。方法如下:
gl-setup
命令添加密钥。不幸的是,我不知道吉特西斯出了什么问题。
Ok I tried gitolite and everything works fine. Here is the method:
apt-get
.gl-setup
command.Unfortunatelly I have no idea what was wrong with gitosis.
我在这个问题上遇到了麻烦。全新安装 gitosis 后,repo gitosis-admin.git 的克隆工作得很好。但是,在生成新的 RSA 密钥对并重新初始化后,
我也遇到了上述错误。
中的公钥后
在比较生成的公钥和我的 gitosis (git) 用户的主页
,我注意到公钥不匹配。
用 id_rsa.pub 的内容替换 authorized_keys 中的密钥后,它就起作用了。
注意:由于authorized_keys文件是由gitosis自动生成和更新的,您还必须确保公钥文件(在我的例子中是id_rsa.pub)放置在keydir< /b> gitosis-admin 存储库的目录。
I was having trouble with this issue. After a fresh install of gitosis, the clone of repo gitosis-admin.git worked just fine. However, after generating a new RSA key pair, and re-initializing with
I also got the above error.
After comparing the public keys in the generated
and the home of my user for gitosis (git)
I noticed, that the public keys didn't match.
After replacing the key in authorized_keys with the content of id_rsa.pub it worked.
Note: Since the authorized_keys file is automatically generated and updated by gitosis, you will also have to make sure, the public key file (id_rsa.pub in my case) is placed in the keydir directory of the gitosis-admin repository.
我们拥有自己的 gitosis 服务器并正在运行。
正确的命令应该是 -
所以,
假设您已经在服务器中创建了一个名为 git 的用户,并且在 gitosis.conf 中有如下内容
We've our own gitosis server up and running.
The proper command should be-
So,
Assuming that you've created a user called
git
in your server and have something like following in yourgitosis.conf