Rag*_*pta 0 linux ssh redhat public-key-encryption rhel7
为 RHEL 客户端生成私钥和公钥并将公钥存储在 RHEL 7 服务器的authorized_keys 文件夹中后,我通过转至 PermitRootLogin并将/etc/ssh/sshd_config其设置为 no 来禁用服务器中的 Root 登录。之后我重新启动了 sshd 服务。
现在,当我尝试从客户端到服务器进行 ssh 时,它说
权限被拒绝(publickey、gssapi-keyex、gssapi-with-mic、密码)
为什么我会收到此消息?
小智 5
你的行为完全正常。更改
PermitRootLogin no
为更符合您的需求
PermitRootLogin without-password
确保在正确的位置(通常是 ~/.ssh/authorized_keys)和良好的所有者:组中拥有正确的密钥,并在 ~/.ssh/authorized_keys 和 ~/.ssh 上使用 chmod 600 和 700。