{"id":637,"date":"2018-11-11T00:24:24","date_gmt":"2018-11-10T16:24:24","guid":{"rendered":"https:\/\/flandre-scarlet.moe\/blog\/?p=637"},"modified":"2025-05-25T01:40:04","modified_gmt":"2025-05-24T17:40:04","slug":"ssh%e4%bd%bf%e7%94%a8%e5%85%ac%e9%92%a5%e7%99%bb%e9%99%86%e8%ae%be%e7%bd%ae%e6%97%b6%e8%bf%94%e5%9b%9e-authentication-refused","status":"publish","type":"post","link":"https:\/\/flandre-scarlet.moe\/blog\/637\/","title":{"rendered":"ssh\u4f7f\u7528\u516c\u94a5\u767b\u9646\u8bbe\u7f6e\u65f6\u8fd4\u56de Authentication Refused"},"content":{"rendered":"<p>\u6700\u8fd1\u7ed9\u51e0\u53f0\u673a\u5668\u8bbe\u7f6e ssh \u516c\u94a5\u767b\u9646\u7684\u65f6\u5019\u53d1\u73b0\u8001\u662f\u5931\u8d25\uff0cputty \u548c ssh \u547d\u4ee4\u90fd\u663e\u793a\u8ba4\u8bc1\u88ab\u62d2\u7edd\u3002\u4eca\u5929\u60f3\u641e\u4e00\u4e2a git server\uff0c\u53c8\u78b0\u5230\u8fd9\u4e2a\u95ee\u9898\u4e86\uff0c\u60f3\u7740\u8fd8\u662f\u5f97\u89e3\u51b3\u4e00\u4e0b\u624d\u884c\u3002<\/p>\n<p>\u4e00\u5f00\u59cb\u60f3\u6362\u4e2a\u73af\u5883\u4e8e\u662f\u5728\u865a\u62df\u673a\u91cc\u5148\u505a\u4e2a\u6d4b\u8bd5\uff0c\u679c\u7136\u4e5f\u51fa\u73b0\u4e86\u65e0\u6cd5\u767b\u5f55\u7684\u60c5\u51b5\u3002\u3002\u3002\u67e5\u770b \/var\/log\/secure \u65e5\u5fd7\uff0c\u53ef\u4ee5\u53d1\u73b0\u6709\u4e0b\u9762\u8fd9\u6837\u7684\u4fe1\u606f\uff1a<br \/>\n<em>Authentication refused: bad ownership or modes for file \/home\/testuser\/.ssh\/authorized_keys<\/em><br \/>\n\u4e0a\u7f51\u67e5\u4e86\u4e00\u4e0b\uff0c\u53d1\u73b0\u662f ssh \u5bf9\u6587\u4ef6\u4ee5\u53ca\u76ee\u5f55\u7684\u6743\u9650\u6709\u8981\u6c42\uff0c\u968f\u610f\u8bbe\u7f6e\u4f1a\u5bfc\u81f4 ssh \u4e0d\u8ba4\u8fd9\u4e2a\u6587\u4ef6\u3002\u540c\u65f6\u53c8\u60f3\u8d77\u4f7f\u7528 ssh \u547d\u4ee4\u767b\u5f55\u65f6\u6709\u65f6\u4f1a\u63d0\u793a\u4f60\u79c1\u94a5\u6743\u9650\u8fc7\u5927\u800c\u5ffd\u7565\u8fd9\u4e2a\u79c1\u94a5<\/p>\n<p><!--more--><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions 0555 for 'id_rsa' are too open.\r\nIt is required that your private key files are NOT accessible by others.\r\nThis private key will be ignored.\r\nbad permissions: ignore key: id_rsa\r\n<\/pre>\n<p>\u56e0\u6b64\u95ee\u9898\u7684\u539f\u56e0\u5e94\u8be5\u5c31\u662f\u8fd9\u4e2a\u4e86\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u8c03\u6574\u76ee\u5f55\u6743\u9650\u3002<br \/>\n\u7528\u6237\u76ee\u5f55\u6743\u9650\u4e3a 755 \u6216\u8005 700\uff0c\u4e0d\u80fd\u662f777\u4e4b\u7c7b\u7684\u3002<br \/>\n.ssh\u76ee\u5f55\u6743\u9650\u53ef\u4ee5\u662f 700 \u6216 755\u3002<br \/>\nrsa_id.pub \u548c authorized_keys \u8bbe\u7f6e\u4e3a 644\u3002<br \/>\nrsa_id \u6743\u9650\u8bbe\u4e3a 600\u3002<\/p>\n<p>\u8bbe\u7f6e\u5b8c\u6210\u540e\u5c31\u53ef\u4ee5\u987a\u5229\u8fde\u63a5\u4e86\u3002<\/p>\n<h3>\u4f7f\u7528 putty \u8fde\u63a5<\/h3>\n<p>\u5728\u521d\u59cb\u7684 Session \u754c\u9762\u586b\u4e0a ip \u548c\u7aef\u53e3\u540e\uff0c\u5207\u6362\u5230 Connection-Data\uff0c\u628a Auto-login username \u6539\u4e3a\u8981\u767b\u5f55\u7684\u7528\u6237\uff0c\u518d\u5207\u6362\u5230 Connection-SSH-Auth\uff0c\u5c06 putty \u7684 ppk \u79c1\u94a5\u8def\u5f84\u586b\u5165\uff0c\u6700\u540e\u8bb0\u5f97\u4fdd\u5b58\u8be5\u8fde\u63a5\uff0c\u8fd9\u6837\u5c31\u80fd\u514d\u9664\u8f93\u5165\u5bc6\u7801\u7684\u9ebb\u70e6\u4e86\u3002<\/p>\n<p>\u6700\u540e\u8865\u5145\u4e24\u4e2a\uff0cgit \u8f93\u5165\u8def\u5f84\u65f6\u8981\u5e26\u4e0a ssh:\/\/ \u524d\u7f00\u3002\u3002\u3002\u4e00\u5f00\u59cb\u770b gayhub \u7684\u8def\u5f84\u662f\u6ca1\u6709\u524d\u7f00\u7684\u5c31\u6ca1\u8f93\uff0c\u7136\u540e\u8001\u662f\u62a5\u6ca1\u6743\u9650\u4ec0\u4e48\u7684\uff0c\u5bb3\u6b7b\u4eba\u554a\u3002\u3002\u3002<br \/>\u8fd8\u6709\u4e00\u4e2a\u5c31\u662f\u65b0\u521b\u5efa git \u4ed3\u5e93\u76ee\u5f55\u6240\u6709\u6743\u522b\u5fd8\u4e86\u8f6c\u79fb\u7ed9\u76f8\u5e94\u7684\u7528\u6237\u3002\u3002<br \/>\u6574\u4e2a\u4e1c\u897f\u641e\u4e0b\u6765\u8db3\u8db3\u82b1\u4e86\u4e00\u4e2a\u665a\u4e0a_(\u2510\u300c\u03b5\uff1a)_\u770b\u770b\u6559\u7a0b\u57fa\u672c\u90fd\u662f\u6ca1\u95ee\u9898\u7684\uff0c\u7136\u800c\u8981\u662f\u67d0\u4e00\u6b65\u5361\u4f4f\u4e86\uff0c\u4f30\u8ba1 90% \u7684\u65f6\u95f4\u90fd\u82b1\u5728\u8fd9\u4e0a\u9762\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u7ed9\u51e0\u53f0\u673a\u5668\u8bbe\u7f6e ssh \u516c\u94a5\u767b\u9646\u7684\u65f6\u5019\u53d1\u73b0\u8001\u662f\u5931\u8d25\uff0cputty \u548c ssh \u547d\u4ee4\u90fd\u663e\u793a\u8ba4\u8bc1\u88ab\u62d2\u7edd\u3002\u4eca\u5929\u60f3\u641e&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/flandre-scarlet.moe\/blog\/637\/\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85],"tags":[73,70,71,69,72],"class_list":["post-637","post","type-post","status-publish","format-standard","hentry","category-programs","tag-git-server","tag-putty","tag-rsa","tag-ssh","tag-72"],"_links":{"self":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/comments?post=637"}],"version-history":[{"count":1,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/637\/revisions"}],"predecessor-version":[{"id":2172,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/637\/revisions\/2172"}],"wp:attachment":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/media?parent=637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/categories?post=637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/tags?post=637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}