无法以 root 用户身份进行 SSH(使用密钥)

无法以 root 用户身份进行 SSH(使用密钥)

我在通过 SSH(使用 RSA 密钥)以 root 用户身份登录时遇到问题。操作系统:Ubuntu 16.04

我的 sshd_config 包括:

PermitRootLogin prohibit-password (tried "yes" as well)
PasswordAuthentication no

我已将 PubKey 添加到远程服务器 ~/.ssh/authorized_keys 文件中。我已编辑~/.ssh/ (700) and authorized_keys (600)文件权限。

不知道哪里出了问题。我可以以非 root 用户身份进行 ssh。

E:添加了详细的连接。

debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the ECDSA host key.
debug1: Found key in /Users/user/.ssh/known_hosts:13
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /Users/user/.ssh/id_rsa (0x7fc729e013b0), explicit, agent
debug2: key:  (0x7fc729f00740), agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/user/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.

相关内容