Gitosis publickey许可被拒绝

时间:2012-02-21 06:31:41

标签: git ssh github redmine gitosis

我有一个gitosis服务器在工作,我也使用github进行个人项目,我试图为两个帐户使用相同的公共和私人ssh密钥,唯一的区别是gitosis中的用户名是md.mercado49和在github是maumercado。

我已经将我的公钥上传到gitosis,当然我已经在github上使用了一段时间了,现在问题是我在尝试连接到gitosis服务器时已经被拒绝了,但是当它连接到github时它成功了同样的关键。

继续使用ssh -vT获得的内容gitosis@repocomit.virtual.uniandes.edu.co命令:

OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to repocomit.virtual.uniandes.edu.co [157.253.238.144] port 22.
debug1: Connection established.
debug1: identity file /Users/maumercado/.ssh/id_rsa type 1
debug1: identity file /Users/maumercado/.ssh/id_rsa-cert type -1
debug1: identity file /Users/maumercado/.ssh/id_dsa type -1
debug1: identity file /Users/maumercado/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu7
debug1: match: OpenSSH_5.3p1 Debian-3ubuntu7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'repocomit.virtual.uniandes.edu.co' is known and matches the RSA host key.
debug1: Found key in /Users/maumercado/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/maumercado/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/maumercado/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).

甚至可以做我想做的事情,使用相同的密钥以及不同的用户名和电子邮件进行身份验证?

我应该为其他帐户生成不同的密钥,如果是,如何生成?

感谢大家的帮助!

...另外,我相信无关紧要,但谁知道,我用github信息设置了git全局配置,但在公司的项目上我有git config --local ...那应该没问题吧? / p>

====更新====

所以我注意到在调试部分中有以下内容:

debug1: Offering RSA public key: /Users/maumercado/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/maumercado/.ssh/id_dsa

为什么它将id_rsa作为我的公钥,当它实际上是私钥而id_dsa作为我的私钥时甚至不存在?

2 个答案:

答案 0 :(得分:1)

使用公共ssh密钥的频率和位置没有限制。密钥中的名称更多用于文档目的。只要系统支持密钥类型(RSA / DSA)。

gitosis能用你的钥匙吗?这在配置上有点棘手。还要确保其中的密钥文件中没有换行符。

关于你的git配置问题:本地设置会覆盖全局设置。但那就像你做的那样好。

答案 1 :(得分:0)

在调试时间过长,思考和分析之后,我重新编写了http://dev.remarkablewit.com/redmine/projects/dev-server/wiki之后的所有内容,至少对我来说,它也适用于gitosis.conf我在[gitosis] loglevel = DEBUG下添加了帮助我多一点。