Capistrano销毁ssh公钥授权

Capistrano销毁ssh公钥授权,ssh,capistrano,public-key,Ssh,Capistrano,Public Key,我遇到了一个问题,在我使用Capistrano部署到的两个不同服务器上,我遇到了两个不同的ssh用户,我对此感到非常困惑。我相信我不是唯一一个遇到这种情况的人: 我使用远程服务器已知的公钥,通过无密码身份验证从命令行设置ssh连接。这样做有效:我可以登录到远程系统 我执行»cap部署:设置«。令人惊讶的是,我必须输入ssh用户的密码,然后每次通过ssh在命令行上登录服务器时,我都必须再次输入密码。不再接受公钥,如ssh的-v选项生成的输出所示: _ 它可以在远程端无密码地拉取git存储库 如何防

我遇到了一个问题,在我使用Capistrano部署到的两个不同服务器上,我遇到了两个不同的ssh用户,我对此感到非常困惑。我相信我不是唯一一个遇到这种情况的人:

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

    它可以在远程端无密码地拉取git存储库

    如何防止Capistrano筛选SSH设置并再次使用公钥身份验证

    非常感谢您的帮助


    编辑:问题是服务器端:我刚刚发现我不能使用其他系统无密码登录到我的远程系统。我如何知道服务器出了什么问题?

    显然cap已经破坏了服务器上的.ssh/authorized_密钥,无论是内容还是模式。authorized_密钥对所有人都是可读的,并且包含我的公钥。刚刚和系统管理员谈过。他说,他为SSH用户设置的监狱可能存在配置问题。所以我们可以先检查一下。无论如何谢谢你的帮助!如果.ssh目录和授权的_密钥文件是组或世界可读的,则ssh公钥登录将不起作用。
    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
    
    set :ssh_options, {:forward_agent => true}