密码少登录无法在Mac

时间:2017-05-15 16:52:50

标签: macos ssh rsa ssh-keys

我创建了公钥和私钥,并更新了服务器上授权密钥文件中的公钥。但是当我尝试从我的Mac访问服务器时,我仍然会收到登录提示。当我尝试调试时,我收到以下日志消息。

Pradeep:~ pkumar$ ssh -v pradeep@10.21.21.46
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 10.21.21.46 [10.21.21.46] port 22.
debug1: Connection established.
debug1: identity file /Users/pkumar/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/pkumar/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/pkumar/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/pkumar/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/pkumar/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/pkumar/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/pkumar/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/pkumar/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2
debug1: match: OpenSSH_7.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.51.1.36:22 as 'pradeep'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:MkMVA3YQfMFzUv3IxILEVdo0VBr1+aHuQP4YTCbZJg4
debug1: Host '10.21.21.46' is known and matches the RSA host key.
debug1: Found key in /Users/pkumar/.ssh/known_hosts:14
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password
debug1: Next authentication method: password
pradeep@10.21.21.46's password:

我哪里错了。

1 个答案:

答案 0 :(得分:0)

debug1: Authentications that can continue: password

这表示客户端或服务器不支持公钥身份验证。客户可能没问题,除非您修改了/etc/ssh/ssh_config

如果您有权访问服务器配置,请检查服务器/etc/ssh/sshd_config并确保已启用PubkeyAuthentication yes