Capistrano破坏了ssh公钥授权

时间:2011-09-23 13:11:45

标签: ssh capistrano public-key

我对我在使用Capistrano部署到的两个不同服务器上遇到两个不同ssh用户的问题完全不了解。我相信我不是唯一一个遇到这个问题的人:

  1. 我使用远程服务器已知的公钥,使用无密码身份验证从命令行设置ssh连接。这有效:我可以登录远程系统。
  2. 我执行»cap deploy:setup«。令人惊讶的是,我必须输入ssh-user的密码,然后我必须在每次通过命令行上的ssh登录服务器时再次输入密码。不再接受公钥,如ssh的-v选项产生的输出所示:
  3. _

    shell$ ssh -vp 5222 my_ssh_user@my-remote-host.de
    OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
    debug1: Reading configuration data /etc/ssh_config
    debug1: Applying options for *
    debug1: Connecting to my-remote-host.de [1.2.3.4] port 5222.
    debug1: Connection established.
    debug1: identity file /Users/martin/.ssh/id_rsa type 1
    debug1: identity file /Users/martin/.ssh/id_rsa-cert type -1
    debug1: identity file /Users/martin/.ssh/id_dsa type -1
    debug1: identity file /Users/martin/.ssh/id_dsa-cert type -1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5ubuntu1
    debug1: match: OpenSSH_5.1p1 Debian-5ubuntu1 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 '[my-remote-host.de]:5222' is known and matches the RSA host key.
    debug1: Found key in /Users/martin/.ssh/known_hosts:9
    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,password
    debug1: Next authentication method: publickey
    debug1: Offering RSA public key: /Users/martin/.ssh/id_rsa
    debug1: Authentications that can continue: publickey,password
    debug1: Trying private key: /Users/martin/.ssh/id_dsa
    debug1: Next authentication method: password
    my_ssh_user@my-remote-host.de's password: <here I enter my password>
    debug1: Authentication succeeded (password).
    Authenticated to my-remote-host.de ([1.2.3.4]:5222).
    debug1: channel 0: new [client-session]
    debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    debug1: Sending environment.
    debug1: Sending env LANG = de_DE.UTF-8
    Linux ve2003 2.6.18-238.5.1.el5.028stab085.5 #1 SMP Thu Apr 14 15:42:34 MSD 2011 x86_64
    
    The programs included with the Ubuntu system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.
    
    To access official Ubuntu documentation, please visit:
    http://help.ubuntu.com/
    Last login: Fri Sep 23 13:05:55 2011 from
    

    我在本地使用Mac OS Lion,在远程端使用Ubuntu。我的Capistrano通过多级扩展扩展。我已经设置了

    set :ssh_options, {:forward_agent => true}
    

    它适用于无密码拉动远程端的git存储库。

    如何阻止Capistrano破解我的SSH设置并让它再次使用公钥验证?

    非常感谢任何帮助!

    编辑:问题是服务器端:我发现我无法使用其他系统无密码登录到我的远程系统。我怎么知道服务器有什么问题?

0 个答案:

没有答案