{"id":1711,"date":"2023-03-26T07:23:36","date_gmt":"2023-03-25T23:23:36","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1711"},"modified":"2023-04-23T21:39:58","modified_gmt":"2023-04-23T13:39:58","slug":"solution-to-authentication-reused-bad-ownership-or-modes-errors-during-ssh-password-free-login","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/26\/solution-to-authentication-reused-bad-ownership-or-modes-errors-during-ssh-password-free-login\/","title":{"rendered":"SSH\u514d\u5bc6\u7801\u767b\u9646\u65f6Authentication refused &#8211; bad ownership or modes\u9519\u8bef\u89e3\u51b3\u65b9\u6cd5"},"content":{"rendered":"<h2>SSH\u516c\u94a5\u514d\u5bc6\u4e0d\u80fd\u767b\u5f55<\/h2>\n<h3>\u95ee\u9898<\/h3>\n<p>\u8bbe\u7f6eSSH\u516c\u94a5\u514d\u5bc6\u7801\u767b\u9646\u65f6\uff0c\u5df2\u7ecf\u8bbe\u7f6e<code>PubkeyAuthentication yes<\/code>\u4ee5\u53ca<code>.ssh\/authorized_keys<\/code>\uff0c\u4ecd\u7136\u4e0d\u80fd\u6b63\u5e38\u767b\u5f55\uff0c\u62a5\u9519\uff1a<\/p>\n<p><!-- more --><\/p>\n<pre><code>Authentication refused: bad ownership or modes<\/code><\/pre>\n<h3>\u8ddf\u8e2a<\/h3>\n<p>\u767b\u9646\u76ee\u6807\u673a\u5668\uff0c\u67e5\u770bsshd\u7684\u65e5\u5fd7\u4fe1\u606f\u3002\u65e5\u5fd7\u4fe1\u606f\u76ee\u5f55\u4e3a<code>\/var\/log\/secure<\/code>\uff0c\u4f1a\u53d1\u73b0\u5982\u4e0b\u5b57\u6837\u7684\u65e5\u5fd7\u4fe1\u606f\uff1a<\/p>\n<pre><code># tail -f \/var\/log\/secure\nMay 22 10:12:21 kec-web sshd[10885]: reprocess config line 43: Deprecated option RSAAuthentication\nMay 22 10:12:21 kec-web sshd[10885]: Authentication refused: bad ownership or modes for directory \/home\/yezhou\/.ssh\nMay 22 10:12:22 kec-web sshd[10885]: Connection closed by 172.26.0.12 port 23058 [preauth]<\/code><\/pre>\n<h2>\u539f\u56e0\u53ca\u89e3\u51b3<\/h2>\n<h3>\u539f\u56e0\u5206\u6790<\/h3>\n<p>sshd\u4e3a\u4e86\u5b89\u5168\uff0c\u5bf9\u5c5e\u4e3b\u7684\u76ee\u5f55\u548c\u6587\u4ef6\u6743\u9650\u6709\u6240\u8981\u6c42\u3002\u5982\u679c\u6743\u9650\u4e0d\u5bf9\uff0c\u5219ssh\u7684\u514d\u5bc6\u7801\u767b\u9646\u4e0d\u751f\u6548\u3002<\/p>\n<ul>\n<li>\u7528\u6237\u76ee\u5f55\u6743\u9650\u4e3a<code>755<\/code>\u6216\u8005<code>700<\/code>\uff0c\u5c31\u662f\u4e0d\u80fd\u662f<code>77x<\/code><\/li>\n<li><code>.ssh<\/code>\u76ee\u5f55\u6743\u9650\u4e00\u822c\u4e3a<code>755<\/code>\u6216\u8005<code>700<\/code><\/li>\n<li><code>rsa_id.pub<\/code>\u53ca<code>authorized_keys<\/code>\u6743\u9650\u4e00\u822c\u4e3a<code>644<\/code><\/li>\n<li><code>rsa_id<\/code>\u6743\u9650\u5fc5\u987b\u4e3a<code>600<\/code><\/li>\n<\/ul>\n<h3>\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<p>\u68c0\u6d4b\u76ee\u5f55\u6743\u9650\uff0c\u628a\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u6309\u8981\u6c42\u8bbe\u7f6e\u6743\u9650\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH\u516c\u94a5\u514d\u5bc6\u4e0d\u80fd\u767b\u5f55 \u95ee\u9898 \u8bbe\u7f6eSSH\u516c\u94a5\u514d\u5bc6\u7801\u767b\u9646\u65f6\uff0c\u5df2\u7ecf\u8bbe\u7f6ePubkeyAuthentication y [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[96],"class_list":["post-1711","post","type-post","status-publish","format-standard","hentry","category-devops-base","tag-ssh"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1711"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1711\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}