{"id":10007041,"date":"2023-01-04T17:24:29","date_gmt":"2023-01-04T09:24:29","guid":{"rendered":"https:\/\/ityet.com\/?p=10007041"},"modified":"2023-01-04T17:24:29","modified_gmt":"2023-01-04T09:24:29","slug":"openssh%e5%8d%87%e7%ba%a7%e5%85%ac%e9%92%a5%e5%a4%b1%e6%95%88permission-denied-publickey%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10007041","title":{"rendered":"openSSH\u5347\u7ea7\u516c\u94a5\u5931\u6548Permission denied (publickey)\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"<h2>\u80cc\u666f<\/h2>\n<p>centos\u7cfb\u7edf\u5347\u7ea7openSSH\u540e\uff0c\u670d\u52a1\u5668\u4e0a\u65e0\u6cd5\u518d\u62c9\u53d6\u4ee3\u7801\uff0c\u62a5\u9519\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043237705\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<h2>\u539f\u56e0<\/h2>\n<p>\u670d\u52a1\u5668\u91cd\u65b0\u5b89\u88c5SSH\u540e\u516c\u94a5\u6539\u53d8\uff0c\u9700\u8981\u91cd\u65b0\u5b89\u88c5<\/p>\n<blockquote><p>ssh-keygen -t rsa -C &#8220;\u90ae\u7bb1\u5730\u5740&#8221;<\/p><\/blockquote>\n<p>\u751f\u6210\u516c\u94a5\uff0c\u5220\u9664gitlab\u539f\u6709\u516c\u94a5\uff0c\u4f46\u662fgit pull\u4f9d\u7136\u62a5\u9519\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043237706\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u4f9d\u7136\u63d0\u793a\u516c\u94a5\u6709\u95ee\u9898\uff0c\u6ca1\u6709pull\u6743\u9650<\/p>\n<h2>\u89e3\u51b3\u65b9\u6848<\/h2>\n<p>1\u3001\u5220\u9664.ssh\/known_hosts\u91cc\u9762\u7684\u5185\u5bb9<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000043237707\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>2\u3001\u5982\u679c\u91cd\u65b0\u751f\u6210\u516c\u94a5\u8fd8\u662f\u6ca1\u6cd5pull\u4ee3\u7801\u53ef\u80fd\u4f1a\u6709\u4e00\u4e0b\u60c5\u51b5<\/p>\n<p>3\u30018.8\u7248\u672c\u5f00\u59cbOpenSSH\u5c31\u4e0d\u652f\u6301rsa\u52a0\u5bc6\u7b97\u6cd5\u4e86\uff0cmac\u4e5f\u662f\u56e0\u4e3a\u5347\u7ea7\u4e86OpenSSH\uff0c\u6240\u4ee5\u4e0d\u652f\u6301rsa\u7b97\u6cd5<\/p>\n<p>4\u3001GitHub \u901a\u8fc7\u5728 2022 \u5e74 3 \u6708 15 \u65e5\u5220\u9664\u65e7\u7684\u3001\u4e0d\u5b89\u5168\u7684\u5bc6\u94a5\u7c7b\u578b\u6765\u63d0\u9ad8\u5b89\u5168\u6027\u3002<\/p>\n<p><code>ssh-dss<\/code> \u81ea\u8be5\u65e5\u671f\u8d77\uff0c\u4e0d\u518d\u652f\u6301 <code>DSA<\/code> \u5bc6\u94a5 ( )\u3002\u60a8\u4e0d\u80fd\u5c06\u65b0\u7684 DSA \u5bc6\u94a5\u6dfb\u52a0\u5230\u60a8\u5728 <code>GitHub.com<\/code> \u4e0a\u7684\u4e2a\u4eba\u5e10\u6237\u3002<\/p>\n<p>2021 \u5e74 11 \u6708 2 \u65e5\u4e4b\u524d\u7684 RSA \u5bc6\u94a5 <code>( ssh-rsa ) valid_after<\/code> \u53ef\u4ee5\u7ee7\u7eed\u4f7f\u7528\u4efb\u4f55\u7b7e\u540d\u7b97\u6cd5\u3002\u5728\u8be5\u65e5\u671f\u4e4b\u540e\u751f\u6210\u7684 RSA \u5bc6\u94a5\u5fc5\u987b\u4f7f\u7528 <code>SHA-2<\/code> \u7b7e\u540d\u7b97\u6cd5\u3002\u4e00\u4e9b\u8f83\u65e7\u7684\u5ba2\u6237\u7aef\u53ef\u80fd\u9700\u8981\u5347\u7ea7\u624d\u80fd\u4f7f\u7528 <code>SHA-2<\/code> \u7b7e\u540d\u3002<\/p>\n<pre><code>ssh-keygen -t ed25519 -C &quot;&lt;comment&gt;&quot;<\/code><\/pre>\n<blockquote><p>\u6ce8\u610f\uff1a\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u4e0d\u652f\u6301 Ed25519 \u7b97\u6cd5\u7684\u65e7\u7cfb\u7edf\uff0c\u8bf7\u4f7f\u7528\uff1a<\/p><\/blockquote>\n<pre><code>ssh-keygen -t rsa -b 4096 -C &quot;&lt;comment&gt;&quot;<\/code><\/pre>\n<p>5\u3001\u4f7f\u7528rsa\u7b97\u6cd5\u751f\u6210\u4e0d\u652f\u6301\u7684\u8bdd\u6539\u7528ed25519\u7684\u52a0\u5bc6\u65b9\u5f0f\u751f\u6210\u516c\u94a5\uff0c\u914d\u7f6e\u540e\u5c31\u53ef\u4ee5\u4e86<\/p>\n<p>\u4ee5\u4e0a\u662f\u672c\u4eba\u5f00\u53d1\u4e2d\u9047\u5230\u7684\u95ee\u9898\uff0c\u4ee5\u53ca\u89e3\u51b3\u65b9\u6848\uff0c\u5982\u679c\u5e2e\u52a9\u8bf7\u9009\u62e9\u4f7f\u7528<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000043237703\">https:\/\/segmentfault.com\/a\/1190000043237703<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f centos\u7cfb\u7edf\u5347\u7ea7openSSH\u540e\uff0c\u670d\u52a1\u5668\u4e0a\u65e0\u6cd5\u518d\u62c9\u53d6\u4ee3\u7801\uff0c\u62a5\u9519\u5982\u4e0b\uff1a \u539f\u56e0 \u670d\u52a1\u5668\u91cd\u65b0\u5b89\u88c5SSH\u540e\u516c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10007041","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10007041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10007041"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10007041\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10007041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10007041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10007041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}