{"id":62,"date":"2012-11-16T11:15:44","date_gmt":"2012-11-16T03:15:44","guid":{"rendered":"https:\/\/blog.vscz.net\/?p=62"},"modified":"2014-08-04T02:53:39","modified_gmt":"2014-08-03T18:53:39","slug":"linux%e7%94%a8%e6%88%b7%e5%88%87%e6%8d%a2%e5%af%bc%e8%87%b4github-push%e5%87%ba%e7%8e%b0permission-denied-publickey%e9%94%99%e8%af%af","status":"publish","type":"post","link":"https:\/\/bylang.cn\/?p=62","title":{"rendered":"Linux\u7528\u6237\u5207\u6362\u5bfc\u81f4github push\u51fa\u73b0Permission denied (publickey)\u9519\u8bef"},"content":{"rendered":"<p style=\"color: #555555;\">\u6700\u8fd1\u5c1d\u8bd5\u4f7f\u7528github\u6258\u7ba1\u4ee3\u7801\uff0c\u524d\u9762\u7684\u6d41\u7a0b\u8fd8\u7b97\u6bd4\u8f83\u987a\u5229\uff0c\u6ca1\u6709\u9047\u5230\u4ec0\u4e48\u5927\u95ee\u9898\uff0c\u57fa\u672c\u53c2\u8003\u7f51\u4e0a\u7684\u6d41\u7a0b\u5c31\u53ef\u4ee5\u3002<\/p>\n<p style=\"color: #555555;\">\u9996\u5148\uff0c\u76f4\u63a5\u5728\u7f51\u9875\u4e0a\u6ce8\u518c\u5e10\u53f7\uff0c\u521b\u5efa\u4ee3\u7801\u4ed3\u5e93repository,\u586b\u5199\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n<p style=\"color: #555555;\">\u7136\u540e\uff0c\u5728linux\u5ba2\u6237\u7aef\uff0c\u7528\u547d\u4ee4:git clone git@github.com:xxx\/xxx.git \u540c\u6b65\u7f51\u9875\u4e0a\u521b\u5efarepository\u5230\u672c\u5730.<\/p>\n<p style=\"color: #555555;\">\u5728\u672c\u5730\u6dfb\u52a0\u6587\u4ef6\uff0cgit add, git commit\u7b49\uff0c\u5177\u4f53\u7684\u53ef\u4ee5\u53c2\u8003\u7f51\u4e0a\u6216\u8005git &#8211;help\u3002<\/p>\n<p style=\"color: #555555;\">\u6700\u540e\u4e00\u6b65\u5c31\u662f\u4e0a\u4f20\u4ee3\u7801\uff0cgit push, \u5982\u679c\u6ca1\u6709\u751f\u6210\u672c\u5730\u516c\u94a5\u79c1\u94a5\u5bf9\u7684\uff0c\u7528ssh-keygen\u751f\u6210\u3002<\/p>\n<p style=\"color: #555555;\">\u7136\u540e\u628a\u516c\u94a5\u7684\u5185\u5bb9\uff0c\u901a\u8fc7\u7f51\u9875\uff0c\u7c98\u8d34\u590d\u5236\uff0c\u63d0\u4ea4\u5230github\u4e2d\u3002<\/p>\n<p style=\"color: #555555;\">\u5728\u6700\u540e\u4e00\u6b65\uff0c\u8981\u5f80github\u7f51\u7ad9\u63a8\u9001\u4ee3\u7801\uff0c\u51fa\u73b0\u95ee\u9898\u4e86\u3002<\/p>\n<p style=\"color: #555555;\">\u51fa\u73b0\u4ee5\u4e0b\u7684\u9519\u8bef\u3002<\/p>\n<p style=\"color: #555555;\"><a style=\"color: #015f91;\" href=\"\/wp-content\/uploads\/2012\/11\/110517108.png\" target=\"_blank\"><img decoding=\"async\" src=\"\/wp-content\/uploads\/2012\/11\/110517108.png\" alt=\"\" border=\"0\" \/><\/a><\/p>\n<p style=\"color: #555555;\">\u8bd5\u4e86\u51e0\u6b21\uff0c\u8fd8\u662f\u4e0d\u884c\uff0c\u5c31\u91cd\u65b0\u751f\u6210\u672c\u5730\u516c\u94a5\u5bc6\u94a5\u5bf9\uff0c\u66ff\u6362\u7f51\u7ad9\u4e0a\u7684ssh key\u3002<\/p>\n<p style=\"color: #555555;\">\u7528\uff1assh -T git@github.com \u6d4b\u8bd5\u4e5f\u8fd8\u4e0d\u884c\u3002<\/p>\n<p style=\"color: #555555;\">\u4ece\u7f51\u4e0a\u627e\u7684\u89e3\u51b3\u529e\u6cd5\uff0c\u5927\u591a\u90fd\u662f\u5b98\u7f51\u5e2e\u52a9\u7684\u7ffb\u8bd1\u7248\u3002<\/p>\n<p style=\"color: #555555;\">https:\/\/help.github.com\/articles\/generating-ssh-keys<\/p>\n<p style=\"color: #555555;\">\u540e\u6765\u5728\u7f51\u4e0a\u627e\u5230\u8fd9\u7bc7\u6587\u7ae0\uff1a<\/p>\n<p style=\"color: #555555;\">http:\/\/www.cnblogs.com\/nani\/archive\/2012\/11\/02\/2751660.html<\/p>\n<p style=\"color: #555555;\">\u53d1\u73b0\u6709\u53ef\u80fd\u662f\u672c\u5730\u5bc6\u94a5\u627e\u4e0d\u5230\u7684\u95ee\u9898\u3002<\/p>\n<p style=\"color: #555555;\">\u7528ssh -vT\u00a0git@github.com\u6d4b\u8bd5\uff0c\u679c\u7136\u662f<\/p>\n<p style=\"color: #555555;\"><a style=\"color: #015f91;\" href=\"\/wp-content\/uploads\/2012\/11\/112348850.png\" target=\"_blank\"><img decoding=\"async\" src=\"\/wp-content\/uploads\/2012\/11\/112348850.png\" alt=\"\" border=\"0\" \/><\/a><\/p>\n<div style=\"color: #555555;\">\u539f\u6765\u662f\u672c\u5730\u5bc6\u94a5\u5bf9\u751f\u6210\u7684\u8def\u5f84\u4e0d\u5bf9\uff0c\u751f\u6210\u5bc6\u94a5\u7528\u7684\u662fsong\u7528\u6237\uff0cgit push\u7528\u7684\u786e\u5b9eroot\u7528\u6237\u3002<\/div>\n<div style=\"color: #555555;\">\u672c\u5730\u5bc6\u94a5\u5bf9\u5b58\u50a8\u5728\/home\/song\/.ssh\/ \u76ee\u5f55\u4e0b\uff0c\u7528root\u7528\u6237\u63a8\u9001\uff0c\u5728root\/.ssh\/ \u76ee\u5f55\u4e0b\u627e\u7684\u5bc6\u94a5\u5bf9\uff0c\u5f53\u7136\u5c31\u4e0d\u5bf9\u4e86\u3002<\/div>\n<div style=\"color: #555555;\"><\/div>\n<div style=\"color: #555555;\">\u5207\u6362\u5230\u5bf9\u5e94\u7684\u7528\u6237\uff0c\u518d\u6b21\u63a8\u9001\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002<\/div>\n<div style=\"color: #555555;\">\n<div>[song@centos6364 FixSizeMemPool]$ git push -u FixSizeMemPool master<\/div>\n<div>Enter passphrase for key &#8216;\/home\/song\/.ssh\/id_rsa&#8217;:<\/div>\n<div>Counting objects: 8, done.<\/div>\n<div>Delta compression using up to 2 threads.<\/div>\n<div>Compressing objects: 100% (7\/7), done.<\/div>\n<div>Writing objects: 100% (7\/7), 3.16 KiB, done.<\/div>\n<div>Total 7 (delta 0), reused 0 (delta 0)<\/div>\n<div>To git@github.com:vscz\/FixSizeMemPool.git<\/div>\n<div>\u00a0 \u00a0223eabd..8b275e2 \u00a0master -&gt; master<\/div>\n<div>Branch master set up to track remote branch master from FixSizeMemPool.<\/div>\n<\/div>\n<div style=\"color: #555555;\"><\/div>\n<div style=\"color: #555555;\">\u88ab\u8fd9\u4e2a\u5c0f\u95ee\u9898\u7ed9\u56f0\u6270\u4e86\u597d\u51e0\u4e2a\u5c0f\u65f6\uff0c\u7ec8\u4e8e\u90fd\u89e3\u51b3\u4e86\uff0c\u770b\u6765\u8c03\u8bd5\u975e\u5e38\u91cd\u8981\u554a\uff0c\u80fd\u5feb\u901f\u627e\u5230\u95ee\u9898\u7684\u6240\u5728\u3002<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5c1d\u8bd5\u4f7f\u7528github\u6258\u7ba1\u4ee3\u7801\uff0c\u524d\u9762\u7684\u6d41\u7a0b\u8fd8\u7b97\u6bd4\u8f83\u987a\u5229\uff0c\u6ca1\u6709\u9047\u5230\u4ec0\u4e48\u5927\u95ee\u9898\uff0c\u57fa\u672c\u53c2\u8003\u7f51\u4e0a\u7684\u6d41\u7a0b\u5c31\u53ef\u4ee5\u3002 \u9996\u5148\uff0c\u76f4\u63a5\u5728\u7f51\u9875\u4e0a\u6ce8\u518c\u5e10\u53f7\uff0c\u521b\u5efa\u4ee3\u7801\u4ed3\u5e93repository,\u586b\u5199\u76f8\u5173\u4fe1\u606f\u3002 \u7136\u540e\uff0c\u5728linux\u5ba2\u6237\u7aef\uff0c\u7528\u547d\u4ee4:git clone git@github.com:xxx\/xxx.git \u540c\u6b65\u7f51\u9875\u4e0a\u521b\u5efarepository\u5230\u672c\u5730. \u5728\u672c\u5730\u6dfb\u52a0\u6587\u4ef6\uff0cgit add, git commit\u7b49\uff0c\u5177\u4f53\u7684\u53ef\u4ee5\u53c2\u8003\u7f51\u4e0a\u6216\u8005git &#8211;help\u3002 \u6700\u540e\u4e00\u6b65\u5c31\u662f\u4e0a\u4f20\u4ee3\u7801\uff0cgit push, \u5982\u679c\u6ca1\u6709\u751f\u6210\u672c\u5730\u516c\u94a5\u79c1\u94a5\u5bf9\u7684\uff0c\u7528ssh-keygen\u751f\u6210\u3002 \u7136\u540e\u628a\u516c\u94a5\u7684\u5185\u5bb9\uff0c\u901a\u8fc7\u7f51\u9875\uff0c\u7c98\u8d34\u590d\u5236\uff0c\u63d0\u4ea4\u5230github\u4e2d\u3002 \u5728\u6700\u540e\u4e00\u6b65\uff0c\u8981\u5f80github\u7f51\u7ad9\u63a8\u9001\u4ee3\u7801\uff0c\u51fa\u73b0\u95ee\u9898\u4e86\u3002 \u51fa\u73b0\u4ee5\u4e0b\u7684\u9519\u8bef\u3002 \u8bd5\u4e86\u51e0\u6b21\uff0c\u8fd8\u662f\u4e0d\u884c\uff0c\u5c31\u91cd\u65b0\u751f\u6210\u672c\u5730\u516c\u94a5\u5bc6\u94a5\u5bf9\uff0c\u66ff\u6362\u7f51\u7ad9\u4e0a\u7684ssh key\u3002 \u7528\uff1assh -T git@github.com \u6d4b\u8bd5\u4e5f\u8fd8\u4e0d\u884c\u3002 \u4ece\u7f51\u4e0a\u627e\u7684\u89e3\u51b3\u529e\u6cd5\uff0c\u5927\u591a\u90fd\u662f\u5b98\u7f51\u5e2e\u52a9\u7684\u7ffb\u8bd1\u7248\u3002 https:\/\/help.github.com\/articles\/generating-ssh-keys \u540e\u6765\u5728\u7f51\u4e0a\u627e\u5230\u8fd9\u7bc7\u6587\u7ae0\uff1a http:\/\/www.cnblogs.com\/nani\/archive\/2012\/11\/02\/2751660.html \u53d1\u73b0\u6709\u53ef\u80fd\u662f\u672c\u5730\u5bc6\u94a5\u627e\u4e0d\u5230\u7684\u95ee\u9898\u3002 \u7528ssh -vT\u00a0git@github.com\u6d4b\u8bd5\uff0c\u679c\u7136\u662f \u539f\u6765\u662f\u672c\u5730\u5bc6\u94a5\u5bf9\u751f\u6210\u7684\u8def\u5f84\u4e0d\u5bf9\uff0c\u751f\u6210\u5bc6\u94a5\u7528\u7684\u662fsong\u7528\u6237\uff0cgit push\u7528\u7684\u786e\u5b9eroot\u7528\u6237\u3002 \u672c\u5730\u5bc6\u94a5\u5bf9\u5b58\u50a8\u5728\/home\/song\/.ssh\/ \u76ee\u5f55\u4e0b\uff0c\u7528root\u7528\u6237\u63a8\u9001\uff0c\u5728root\/.ssh\/ \u76ee\u5f55\u4e0b\u627e\u7684\u5bc6\u94a5\u5bf9\uff0c\u5f53\u7136\u5c31\u4e0d\u5bf9\u4e86\u3002 \u5207\u6362\u5230\u5bf9\u5e94\u7684\u7528\u6237\uff0c\u518d\u6b21\u63a8\u9001\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002 [song@centos6364 FixSizeMemPool]$ git push -u FixSizeMemPool master Enter passphrase for key &#8216;\/home\/song\/.ssh\/id_rsa&#8217;: Counting objects: 8, done. Delta compression using [&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":[],"class_list":["post-62","post","type-post","status-publish","format-standard","hentry","category-9"],"_links":{"self":[{"href":"https:\/\/bylang.cn\/index.php?rest_route=\/wp\/v2\/posts\/62","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bylang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bylang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bylang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bylang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=62"}],"version-history":[{"count":4,"href":"https:\/\/bylang.cn\/index.php?rest_route=\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":67,"href":"https:\/\/bylang.cn\/index.php?rest_route=\/wp\/v2\/posts\/62\/revisions\/67"}],"wp:attachment":[{"href":"https:\/\/bylang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bylang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bylang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}