{"id":3225,"date":"2012-07-14T11:50:43","date_gmt":"2012-07-14T03:50:43","guid":{"rendered":"http:\/\/jpuyy.com\/?p=3225"},"modified":"2013-11-15T15:27:11","modified_gmt":"2013-11-15T07:27:11","slug":"use-github-and-change-computer","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=3225","title":{"rendered":"\u4f7f\u7528github\u6362\u7535\u8111\u4e86\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"<p>github\u4f7f\u7528ssh\u8ba4\u8bc1\uff0c\u8bf4\u767d\u4e86\u5c31\u662f\u8ba4\u8bc1\u5173\u7cfb\uff0c\u4ee5\u524d\u7535\u8111A(\u7b14\u8bb0\u672cubuntu)\u7684~\/.ssh\/id_rsa\u4e0b\u6709\u79c1\u94a5\uff0cgithub\u4e0a\u586b\u5199\u597d\u4e86\u516c\u94a5\u5185\u5bb9id_rsa.pub\uff0c\u8ba4\u8bc1\u5173\u7cfb\u6253\u901a\u4e86\u3002<\/p>\n<p>\u79c1\u94a5\u8981\u4fdd\u62a4\u597d\uff0c\u516c\u94a5\u968f\u4fbf\u7528\u3002\u516c\u94a5\u5c31\u597d\u6bd4\u4f60\u5bb6\u5927\u95e8\uff0c\u79c1\u94a5\u662f\u94a5\u5319\uff0c\u5927\u95e8\u53ef\u4ee5\u968f\u4fbf\u7ed9\u4eba\u770b\u5230\uff0c\u4f46\u94a5\u5319\u4e0d\u80fd\u7ed9\u4eba\u968f\u4fbf\u7528\u3002\u79c1\u94a5\u7684\u9ed8\u8ba4\u540d\u5b57\u662fid_rsa\uff0c\u5b83\u7684\u6743\u9650\u662f600\u3002<\/p>\n<p>\u73b0\u5728\u5982\u679c\u6362\u7535\u8111B(\u5982vps)\uff0c\u4e5f\u662f\u7528linux\uff0c\u90a3\u4e48\u73b0\u5728\u6709\u4e24\u79cd\u65b9\u6cd5\uff0c<\/p>\n<h2>\u65b9\u6cd5\u4e00\uff1a\u628aA\u4e0a\u7684\u5bc6\u94a5\u62f7\u8d1d\u5230B\u4e0a\uff0c\u4e3a\u4e86\u4e0d\u5f71\u54cdvps\u7684\u5176\u4ed6\u4f7f\u7528\uff0c\u540d\u5b57\u4e0d\u4f7f\u7528id_rsa\uff0c\u8fd9\u91cc\u540d\u5b57\u6539\u4e3a\uff0cid_rsa.github\uff08\u76f8\u5f53\u4e8e\u4e3a\u4e00\u4e2a\u5927\u95e8\uff0c\u518d\u914d\u4e00\u628a\u94a5\u5319\uff09<\/h2>\n<p>\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<pre>cp A\u4e0a~\/.ssh\/id_rsa \u00a0\u5230B\u4e0a\u00a0~\/.ssh\/id_rsa.github\uff0c\u5e76\u628a\u6743\u9650\u6539\u4e3a600<\/pre>\n<p>\u5728B\u4e0a\u521b\u5efa~\/.ssh\/config\uff0c\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\uff0c\u4fdd\u5b58\u9000\u51fa\u3002<\/p>\n<p>\u5b83\u58f0\u540d\u4e86\u76ee\u6807\u4e3b\u673a\u662fgithub.com\uff0c\u7528\u6237git\uff0c\u8ba4\u8bc1\u65b9\u5f0f\u548c\u6587\u4ef6\uff0c<\/p>\n<p>PS:\u4e3a\u65b9\u4fbf\u8fde\u63a5\u5176\u4ed6\u4e3b\u673a\u65f6\u4e5f\u53ef\u7528\u8fd9\u79cd\u65b9\u6cd5\uff0c\u5728\u540c\u4e00\u673a\u5668\u4e0a\u8fde\u63a5\u591a\u4e2agithub\u8d26\u53f7\u4e5f\u53ef\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\u3002<a href=\"http:\/\/rsylareclipse.blog.163.com\/blog\/static\/18550144020121285148377\/\">http:\/\/rsylareclipse.blog.163.com\/blog\/static\/18550144020121285148377\/<\/a><\/p>\n<pre>Host github.com\r\n User git\r\n Hostname github.com\r\n PreferredAuthentications publickey\r\n IdentityFile ~\/.ssh\/id_rsa.github<\/pre>\n<p>\u6d4b\u8bd5\u4e0b\u80fd\u6210\u529f<\/p>\n<pre>jpuyy@www:~\/.ssh$ ssh -T git@github.com\r\n Hi jpuyy! You've successfully authenticated, but GitHub does not provide shell access.<\/pre>\n<h2>\u65b9\u6cd5\u4e8c\uff1a\u7528ssh-keygen\u91cd\u65b0\u751f\u6210ssh\u516c\u94a5\/\u5bc6\u94a5\u5bf9\uff08\u76f8\u5f53\u4e8e\u91cd\u65b0\u5f00\u8f9f\u4e00\u4e2a\u5927\u95e8\u5e76\u914d\u597d\u94a5\u5319\uff09<\/h2>\n<p>\u8fd9\u548c\u5728A\u4e0a\u7b2c\u4e00\u6b21\u4f7f\u7528\u65f6\u65b9\u6cd5\u4e00\u6837\uff0c\u4f46\u4e3a\u4e86\u4e0d\u4f7f\u7528\u9ed8\u8ba4\u540did_rsa\uff0c\u53ef\u7528\u5982\u4e0b\u547d\u4ee4<\/p>\n<pre>ssh-keygen -C \"jpuyy.com@gmail.com\" -f ~\/.ssh\/id_rsa.github<\/pre>\n<p>\u8fd9\u65f6\u628aid_rsa.github.pub\u7684\u5185\u5bb9copy\u5230\u5bf9\u5e94github.com\u7684ssh\u516c\u94a5\u91cc<\/p>\n","protected":false},"excerpt":{"rendered":"<p>github\u4f7f\u7528ssh\u8ba4\u8bc1\uff0c\u8bf4\u767d\u4e86\u5c31\u662f\u8ba4\u8bc1\u5173\u7cfb\uff0c\u4ee5\u524d\u7535\u8111A(\u7b14\u8bb0\u672cubuntu)\u7684~\/.ssh\/id_rsa\u4e0b\u6709\u79c1\u94a5\uff0cgithub\u4e0a\u586b\u5199\u597d\u4e86\u516c\u94a5\u5185\u5bb9id_rsa.pub\uff0c\u8ba4\u8bc1\u5173\u7cfb\u6253\u901a\u4e86\u3002 \u79c1\u94a5\u8981\u4fdd\u62a4\u597d\uff0c\u516c\u94a5\u968f\u4fbf\u7528\u3002\u516c\u94a5\u5c31\u597d\u6bd4\u4f60\u5bb6\u5927\u95e8\uff0c\u79c1\u94a5\u662f\u94a5\u5319\uff0c\u5927\u95e8\u53ef\u4ee5\u968f\u4fbf\u7ed9\u4eba\u770b\u5230\uff0c\u4f46\u94a5\u5319\u4e0d\u80fd\u7ed9\u4eba\u968f\u4fbf\u7528\u3002\u79c1\u94a5\u7684\u9ed8\u8ba4\u540d\u5b57\u662fid_rsa\uff0c\u5b83\u7684\u6743\u9650\u662f600\u3002 \u73b0\u5728\u5982\u679c\u6362\u7535\u8111B(\u5982vps)\uff0c\u4e5f\u662f\u7528linux\uff0c\u90a3\u4e48\u73b0\u5728\u6709\u4e24\u79cd\u65b9\u6cd5\uff0c \u65b9\u6cd5\u4e00\uff1a\u628aA\u4e0a\u7684\u5bc6\u94a5\u62f7\u8d1d\u5230B\u4e0a\uff0c\u4e3a\u4e86\u4e0d\u5f71\u54cdvps\u7684\u5176\u4ed6\u4f7f\u7528\uff0c\u540d\u5b57\u4e0d\u4f7f\u7528id_rsa\uff0c\u8fd9\u91cc\u540d\u5b57\u6539\u4e3a\uff0cid_rsa.github\uff08\u76f8\u5f53\u4e8e\u4e3a\u4e00\u4e2a\u5927\u95e8\uff0c\u518d\u914d\u4e00\u628a\u94a5\u5319\uff09 \u6b65\u9aa4\u5982\u4e0b\uff1a cp A\u4e0a~\/.ssh\/id_rsa \u00a0\u5230B\u4e0a\u00a0~\/.ssh\/id_rsa.github\uff0c\u5e76\u628a\u6743\u9650\u6539\u4e3a600 \u5728B\u4e0a\u521b\u5efa~\/.ssh\/config\uff0c\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\uff0c\u4fdd\u5b58\u9000\u51fa\u3002 \u5b83\u58f0\u540d\u4e86\u76ee\u6807\u4e3b\u673a\u662fgithub.com\uff0c\u7528\u6237git\uff0c\u8ba4\u8bc1\u65b9\u5f0f\u548c\u6587\u4ef6\uff0c PS:\u4e3a\u65b9\u4fbf\u8fde\u63a5\u5176\u4ed6\u4e3b\u673a\u65f6\u4e5f\u53ef\u7528\u8fd9\u79cd\u65b9\u6cd5\uff0c\u5728\u540c\u4e00\u673a\u5668\u4e0a\u8fde\u63a5\u591a\u4e2agithub\u8d26\u53f7\u4e5f\u53ef\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\u3002http:\/\/rsylareclipse.blog.163.com\/blog\/static\/18550144020121285148377\/ Host github.com User git Hostname github.com PreferredAuthentications publickey IdentityFile ~\/.ssh\/id_rsa.github \u6d4b\u8bd5\u4e0b\u80fd\u6210\u529f jpuyy@www:~\/.ssh$ ssh -T git@github.com Hi jpuyy! You&#8217;ve successfully authenticated, but GitHub does not provide shell access. \u65b9\u6cd5\u4e8c\uff1a\u7528ssh-keygen\u91cd\u65b0\u751f\u6210ssh\u516c\u94a5\/\u5bc6\u94a5\u5bf9\uff08\u76f8\u5f53\u4e8e\u91cd\u65b0\u5f00\u8f9f\u4e00\u4e2a\u5927\u95e8\u5e76\u914d\u597d\u94a5\u5319\uff09 \u8fd9\u548c\u5728A\u4e0a\u7b2c\u4e00\u6b21\u4f7f\u7528\u65f6\u65b9\u6cd5\u4e00\u6837\uff0c\u4f46\u4e3a\u4e86\u4e0d\u4f7f\u7528\u9ed8\u8ba4\u540did_rsa\uff0c\u53ef\u7528\u5982\u4e0b\u547d\u4ee4 ssh-keygen -C &#8220;jpuyy.com@gmail.com&#8221; -f ~\/.ssh\/id_rsa.github \u8fd9\u65f6\u628aid_rsa.github.pub\u7684\u5185\u5bb9copy\u5230\u5bf9\u5e94github.com\u7684ssh\u516c\u94a5\u91cc<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-3225","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3225"}],"version-history":[{"count":7,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3225\/revisions"}],"predecessor-version":[{"id":5832,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3225\/revisions\/5832"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}