SSH登录服务器之间仍然要求密码,为什么? [英] SSH login between servers still asking for password, why?

查看:359
本文介绍了SSH登录服务器之间仍然要求密码,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个服务器标识为 server-1 - 192.168.3.128 server-2 - 192.168.3.130 。我设置 capifony 用于从server-1到server-2的自动部署,这是我到目前为止所做的:

I have two servers identified as server-1 - 192.168.3.128 and server-2 - 192.168.3.130. I am setting up capifony for automatic deployment from server-1 to server-2 and this is what I have done so far:


  1. 在这两个服务器中,我创建了一个用户 deploy ,无需密码,因为这是我将用于部署的用户。

  2. 在服务器1中,通过运行以下命令设置SSH密钥: ssh-keygen ,并且不带密码短语和默认目录。

  3. 我已将伺服器-1的 /home/deploy/.ssh/id_rsa.pub 内容复制到伺服器-2 /home/deploy/.ssh/authorized_keys

  4. 从服务器1我尝试通过运行 ssh deploy@192.168.3.130 到达服务器2,一个密码(下面是输出)

  1. In both servers I have created a user deploy without password since that's the user I will use for deployment.
  2. In server-1 I setup a SSH keys by running the command: ssh-keygen and I leave without pass-phrase and default directories.
  3. I have copied the content of /home/deploy/.ssh/id_rsa.pub at server-1 into server-2 at /home/deploy/.ssh/authorized_keys.
  4. From server-1 I try to reach server-2 by running ssh deploy@192.168.3.130 and it's asking for a password (below is the output)

$ ssh deploy@192.168.3.130
The authenticity of host '192.168.3.130 (192.168.3.130)' can't be established.
RSA key fingerprint is 3c:81:da:7a:78:0f:b0:2f:44:3b:62:fb:c9:6f:33:86.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.3.130' (RSA) to the list of known hosts.
deploy@192.168.3.130's password:



$ b b

这是上面命令的 -v 输出:

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.3.130 [192.168.3.130] port 22.
debug1: Connection established.
debug1: identity file /home/deploy/.ssh/identity type -1
debug1: identity file /home/deploy/.ssh/identity-cert type -1
debug1: identity file /home/deploy/.ssh/id_rsa type 1
debug1: identity file /home/deploy/.ssh/id_rsa-cert type -1
debug1: identity file /home/deploy/.ssh/id_dsa type -1
debug1: identity file /home/deploy/.ssh/id_dsa-cert type -1
debug1: identity file /home/deploy/.ssh/id_ecdsa type -1
debug1: identity file /home/deploy/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
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 '192.168.3.130' is known and matches the RSA host key.
debug1: Found key in /home/deploy/.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: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Cannot determine realm for numeric host address

debug1: Unspecified GSS failure.  Minor code may provide more information
Cannot determine realm for numeric host address

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Unspecified GSS failure.  Minor code may provide more information
Cannot determine realm for numeric host address

debug1: Next authentication method: publickey
debug1: Trying private key: /home/deploy/.ssh/identity
debug1: Offering public key: /home/deploy/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/deploy/.ssh/id_dsa
debug1: Trying private key: /home/deploy/.ssh/id_ecdsa
debug1: Next authentication method: password
deploy@192.168.3.130's password:

为什么?

推荐答案

除了以详细模式运行客户端之外,在调试模式下启动一个新的服务器实例另一个端口:

In addition to running the client in verbose mode, start a new server instance in debug mode on another port:

服务器2作为根用户:

# /usr/sbin/sshd -p 9999 -d

然后以详细模式连接到该服务器端口:

Then connect in verbose mode to that server on the same port:

服务器1作为deploy

server-1 as deploy

$ ssh -vvv -p 9999 server-2

9/10它与权限相关。

9/10 it has to do with permissions.

这篇关于SSH登录服务器之间仍然要求密码,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆