【发布时间】:2012-02-21 06:31:41
【问题描述】:
我有一个 gitosis 服务器在工作,我也将 github 用于个人项目,我试图为两个帐户使用相同的公共和私有 ssh 密钥,唯一的区别是 gitosis 中的用户名是 md.mercado49 和在 github 中是 maumercado。
我已经将我的公钥上传到了 gitosis,当然我在 github 上已经有一段时间了,现在的问题是我在尝试连接到 gitosis 服务器时权限被拒绝,但是在使用 github 连接到 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 global config,但是在我有 git config --local 的公司的项目上...这应该没问题吧?
==== 更新 ====
所以我在调试部分注意到以下内容:
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 作为我的私钥?
【问题讨论】:
标签: git ssh github redmine gitosis