开发者

Capistrano destroys ssh public key authorisation

开发者 https://www.devze.com 2023-04-07 04:38 出处:网络
I am quite out of my depths with a problem that I have faced with two different ssh-users on two different servers where I deploy to with Capistrano. I am sure I am not the only one to have come acros

I am quite out of my depths with a problem that I have faced with two different ssh-users on two different servers where I deploy to with Capistrano. I am sure I am not the only one to have come across this:

  1. I set up an ssh-connection from the command line with passwordless authentication, using my public key, that is known to the remote server. This works: I can log into the remote system.
  2. I execu开发者_运维技巧te »cap deploy:setup«. Surprisingly, I have to enter the password of the ssh-user, and from then I have to enter the password again each time I log into the server via ssh on the command line. The public key is not accepted any more, as shown by the output produced by ssh's -v option:

_

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

I am using Mac OS Lion locally and Ubuntu on the remote side. My Capistrano is extended by the multistage-extension. I have set

set :ssh_options, {:forward_agent => true}

and it works for the passwordless pulling of the git repository on the remote side.

How can I prevent Capistrano to scrumble up my SSH settings and make it use public key auth again?

Greatly appreciate any help!

EDIT: The problem is Server-side: I just found out that I cannot use other systems to passwordless log into my remote system. How can I know what is wrong with the server?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号