即使给出了公钥,Gitosis也需要密码 [英] Gitosis requires password even though the public key is given

查看:708
本文介绍了即使给出了公钥,Gitosis也需要密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Archlinux上配置gitosis时,遇到了一些问题

I'm confronted with some problems when trying to configure gitosis on my Archlinux

http://wiki.archlinux.org/index.php/Setting_Up_Git_ACL_Using_gitosis

我提到这篇wiki文章并成功安装gitosis。

I referred to this wiki article and successfully installed gitosis.


$ sudo pacman -U gitosis-git-20090525-1-i686.pkg.tar.gz >
$ sudo -H -u gitosis gitosis-init< /tmp/id_rsa.pub

$ sudo pacman -U gitosis-git-20090525-1-i686.pkg.tar.gz
$ sudo -H -u gitosis gitosis-init < /tmp/id_rsa.pub

修改/srv/gitosis/.ssh/authorized_keys以包含我的本地用户的id_rsa.pub。

And modified /srv/gitosis/.ssh/authorized_keys to include my local user's id_rsa.pub.

但是当我以本地用户身份运行 git clone 时,

But when I run git clone as the local user,


$ git clone gitosis @ host:gitosis-admin.git

$ git clone gitosis@host:gitosis-admin.git


所以git克隆操作失败。我想知道为什么它会尝试在我的本地用户目录(/ home / wyx)中初始化一个空的git存储库?而且由于我已经在.ssh / authorized_keys中添加了本地用户的id_rsa.pub,为什么它仍然要求输入密码?

So the git clone operation failed. I'm wondering why it tries to initialize an empty git repository in my local user's directory (/home/wyx)? And since I've already added local user's id_rsa.pub in .ssh/authorized_keys, why does it still ask for password?

推荐答案

创建一个空的存储库是因为这只是git的工作方式:它必须在可以开始拖动远程对象之前初始化回购进去。不幸的是,这意味着您必须在再次尝试克隆之前手动删除空回购。

An empty repository was created because that's just how git works: it has to init a repo before it can start pulling remote objects into it. Unfortunately this means you'll have to manually delete the empty repo before you try cloning again.

至于克隆失败的原因,看起来您使用的是错误的远程存储库路径的语法; git clone 不使用scp语法。事实上,如果你没有指定一个克隆协议,我认为它假定了git协议而不是ssh,这可能就是它要求你输入密码的原因。试试这个:

As for why the clone failed, it looks like you're using the wrong syntax for the remote repository path; git clone doesn't use scp syntax. In fact, if you don't specify a clone protocol, I believe it assumes the git protocol rather than ssh, which would probably be why it asked you for a password. Try this instead:


$ git clone ssh://gitosis@host/~/gitosis-admin.git

这篇关于即使给出了公钥,Gitosis也需要密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆