macOS上的密码SSH失败

好玩的

我正在尝试在mini和bigmac两台Mac上设置无密码登录。它在一个而不是另一个上工作。在每台机器上:

我使用“ ssh-keygen -t rsa”生成id_rsa和id_rsa.pub(在要求输入密码时按Enter键)。我将生成的文件转换为〜/ .ssh,然后将scp id_rsa.pub转换为对面的Mac的〜/ .ssh / authorized_keys。

对于从“ mini”到“ bigmac”的ssh,无密码登录有效。当我尝试从“ bigmac”转换为“ mini”时,要求输入密码:

bigmac:~ jedevnull$ cd .ssh
bigmac:.ssh jedevnull$ ls
authorized_keys id_rsa      id_rsa.pub      known_hosts
bigmac:.ssh jedevnull$ ssh -v mini

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to mini [192.168.1.20] port 22.
debug1: Connection established.
debug1: identity file /Users/jedevnull/.ssh/id_rsa type 1
debug1: identity file /Users/jedevnull/.ssh/id_rsa-cert type -1
debug1: identity file /Users/jedevnull/.ssh/id_dsa type -1
debug1: identity file /Users/jedevnull/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.9
debug1: match: OpenSSH_6.9 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<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: Server host key: RSA 0d:2e:de:45:00:ff:9b:ff:96:c5:f6:bd:c6:6a:b0:ec
debug1: Host 'mini' is known and matches the RSA host key.
debug1: Found key in /Users/jedevnull/.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,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/jedevnull/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /Users/jedevnull/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password:

bigmac的id_rsa.pub和mini的authorized_keys相同。

用户名

为了找到问题的原因,在连接的服务器端和客户端上都看到调试消息将很有帮助。所述-d服务器上的选项允许在终端详细的调试消息的单个连接(或拒绝)。因此,例如,在服务器端运行

/usr/sbin/sshd -d -p2222

(在非标准端口上运行,因此不会干扰常规端口sshd),并且在客户端

ssh -v -p2222 ${SERVER_IP}

有关更多细节,

/usr/sbin/sshd -dd -p2222
ssh -vv -p2222 ${SERVER_IP}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

TOP 榜单

热门标签

归档