SSH 开启但是无法登陆

通过 /var/log/secure 查看错误信息 Authentication refused: bad ownership or modes for directory /root 原因是 相关的目录权限不对!

sshd为了安全,对属主的目录和文件权限有所要求。如果权限不对,则ssh的免密码登陆不生效。

用户目录权限为 755 或者 700,就是不能是77x。 .ssh目录权限一般为755或者700。 rsa_id.pub 及authorized_keys权限一般为644 rsa_id权限必须为600

今天学习到这些窍门, 如果不知道够折腾人的

评论

h
hw_7864

⭐️ Admin快速开发: https://show.cool-admin.com/

赞 0
h
hw_7864

⭐️ 官方文档: https://cool-js.com

赞 0
h
hw_7864

⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld

赞 0