{"id":21647,"date":"2024-11-19T12:28:39","date_gmt":"2024-11-19T04:28:39","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21647\/"},"modified":"2024-11-19T12:28:39","modified_gmt":"2024-11-19T04:28:39","slug":"git%e5%af%86%e9%92%a5%e6%80%8e%e4%b9%88%e7%94%9f%e6%88%90","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21647\/","title":{"rendered":"git\u5bc6\u94a5\u600e\u4e48\u751f\u6210"},"content":{"rendered":"<blockquote><p>\n  git \u5bc6\u94a5\u662f\u7528\u4e8e\u5b89\u5168\u8bbf\u95ee git \u4ed3\u5e93\u7684\u52a0\u5bc6\u6587\u4ef6\uff0c\u53ef\u4ee5\u8ba9\u4f60\u5728\u4e0d\u8f93\u5165\u5bc6\u7801\u7684\u60c5\u51b5\u4e0b\u63a8\u9001\u548c\u62c9\u53d6\u4ee3\u7801\u3002\u751f\u6210 git \u5bc6\u94a5\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a\u4f7f\u7528\u547d\u4ee4 ssh-keygen -t rsa -b 4096 \u8fd0\u884c ssh \u5bc6\u94a5\u751f\u6210\u5668\u3002\u6309\u63d0\u793a\u8f93\u5165\u5bc6\u7801\uff08\u53ef\u9009\uff09\u3002\u6307\u5b9a\u5bc6\u94a5\u4fdd\u5b58\u8def\u5f84\uff08\u9ed8\u8ba4 ~\/.ssh\uff09\u3002\u5c06\u5bc6\u94a5\u6dfb\u52a0\u5230 ssh \u4ee3\u7406\uff08\u53ef\u9009\uff09\uff1assh-add ~\/.ssh\/id_rsa\u3002\u4f7f\u7528 ssh -t git@github.com \u9a8c\u8bc1\u5bc6\u94a5\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/24\/2024062421044621023.jpg\" class=\"aligncenter\" title=\"git\u5bc6\u94a5\u600e\u4e48\u751f\u6210\u63d2\u56fe\" alt=\"git\u5bc6\u94a5\u600e\u4e48\u751f\u6210\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u751f\u6210 Git \u5bc6\u94a5\uff1f<\/strong><\/p>\n<p>Git \u5bc6\u94a5\u662f\u7528\u4e8e\u5b89\u5168\u8bbf\u95ee Git \u4ed3\u5e93\u7684\u52a0\u5bc6\u6587\u4ef6\u3002\u5b83\u4eec\u5141\u8bb8\u4f60\u5728\u4e0d\u8f93\u5165\u5bc6\u7801\u7684\u60c5\u51b5\u4e0b\u5411\u8fdc\u7a0b\u4ed3\u5e93\u63a8\u9001\u548c\u62c9\u53d6\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u751f\u6210 Git \u5bc6\u94a5\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26<\/strong><\/p>\n<p>\u5728\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\uff0c\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u8fd0\u884c SSH \u5bc6\u94a5\u751f\u6210\u5668<\/strong><\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c SSH \u5bc6\u94a5\u751f\u6210\u5668\uff1a<\/p>\n<pre>ssh-keygen -t rsa -b 4096<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>-t rsa \u6307\u5b9a\u5bc6\u94a5\u7c7b\u578b\uff08RSA\uff09\u3002<\/li>\n<li>-b 4096 \u6307\u5b9a\u5bc6\u94a5\u957f\u5ea6\uff08\u6bd4\u7279\uff09\u3002\u4f60\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u957f\u5ea6\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 3\uff1a\u8f93\u5165\u5bc6\u7801\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<p>\u7cfb\u7edf\u5c06\u63d0\u793a\u4f60\u8f93\u5165\u4e00\u4e2a\u5bc6\u7801\u6765\u4fdd\u62a4\u4f60\u7684\u5bc6\u94a5\u3002\u5982\u679c\u4f60\u4e0d\u5e0c\u671b\u4f7f\u7528\u5bc6\u7801\uff0c\u53ea\u9700\u6309 Enter \u952e\u5373\u53ef\u3002<\/p>\n<p><strong>\u6b65\u9aa4 4\uff1a\u4fdd\u5b58\u5bc6\u94a5<\/strong><\/p>\n<p>\u7cfb\u7edf\u5c06\u63d0\u793a\u4f60\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\u6765\u4fdd\u5b58\u4f60\u7684\u5bc6\u94a5\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5b83\u4eec\u5c06\u4fdd\u5b58\u5728 ~\/.ssh \u76ee\u5f55\u4e2d\u3002<\/p>\n<p><strong>\u6b65\u9aa4 5\uff1a\u6dfb\u52a0\u5bc6\u94a5\u5230 SSH \u4ee3\u7406\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<p>\u751f\u6210\u5bc6\u94a5\u540e\uff0c\u4f60\u53ef\u4ee5\u5c06\u5176\u6dfb\u52a0\u5230 SSH \u4ee3\u7406\u4e2d\uff0c\u4ee5\u4fbf\u5728\u9700\u8981\u65f6\u81ea\u52a8\u4f7f\u7528\u3002\u4e3a\u6b64\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>ssh-add ~\/.ssh\/id_rsa<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 6\uff1a\u9a8c\u8bc1\u5bc6\u94a5<\/strong><\/p>\n<p>\u8981\u9a8c\u8bc1\u4f60\u7684\u5bc6\u94a5\u662f\u5426\u5df2\u6210\u529f\u751f\u6210\uff0c\u8bf7\u8fd0\u884c\uff1a<\/p>\n<pre>ssh -T git@github.com<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u4f60\u6536\u5230\u4e86\u4ee5\u4e0b\u6d88\u606f\uff0c\u5219\u8868\u793a\u4f60\u7684\u5bc6\u94a5\u5df2\u6210\u529f\u9a8c\u8bc1\uff1a<\/p>\n<pre>Hi &lt;\u4f60\u7684 GitHub \u7528\u6237\u540d&gt;! You've successfully authenticated, but GitHub does not provide shell access.<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5bc6\u94a5\u600e\u4e48\u751f\u6210\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>git \u5bc6\u94a5\u662f\u7528\u4e8e\u5b89\u5168\u8bbf\u95ee git \u4ed3\u5e93\u7684\u52a0\u5bc6\u6587\u4ef6\uff0c\u53ef\u4ee5\u8ba9\u4f60\u5728\u4e0d\u8f93\u5165\u5bc6\u7801\u7684\u60c5\u51b5\u4e0b\u63a8\u9001\u548c\u62c9\u53d6\u4ee3\u7801\u3002\u751f\u6210 git \u5bc6\u94a5\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a\u4f7f\u7528\u547d\u4ee4 ssh-keygen -t rsa -b 4096 \u8fd0\u884c ssh \u5bc6\u94a5\u751f\u6210\u5668\u3002\u6309\u63d0\u793a\u8f93\u5165\u5bc6\u7801\uff08\u53ef\u9009\uff09\u3002\u6307\u5b9a\u5bc6\u94a5\u4fdd\u5b58\u8def\u5f84\uff08\u9ed8\u8ba4 ~\/.ssh\uff09\u3002\u5c06\u5bc6\u94a5\u6dfb\u52a0\u5230 ssh \u4ee3\u7406\uff08\u53ef\u9009\uff09\uff1assh-add ~\/.ssh\/id_rsa\u3002\u4f7f\u7528 ssh -t git@github.com \u9a8c\u8bc1\u5bc6\u94a5\u3002 \u5982\u4f55\u751f\u6210 Git \u5bc6\u94a5\uff1f Git \u5bc6\u94a5\u662f\u7528\u4e8e\u5b89\u5168\u8bbf\u95ee Git \u4ed3\u5e93\u7684\u52a0\u5bc6\u6587\u4ef6\u3002\u5b83\u4eec\u5141\u8bb8\u4f60\u5728\u4e0d\u8f93\u5165\u5bc6\u7801\u7684\u60c5\u51b5\u4e0b\u5411\u8fdc\u7a0b\u4ed3\u5e93\u63a8\u9001\u548c\u62c9\u53d6\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u751f\u6210 Git \u5bc6\u94a5\uff1a \u6b65\u9aa4 1\uff1a\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26 \u5728\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\uff0c\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002 \u6b65\u9aa4 2\uff1a\u8fd0\u884c SSH \u5bc6\u94a5\u751f\u6210\u5668 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c SSH \u5bc6\u94a5\u751f\u6210\u5668\uff1a ssh-keygen -t rsa -b 4096 \u767b\u5f55\u540e\u590d\u5236 -t rsa \u6307\u5b9a\u5bc6\u94a5\u7c7b\u578b\uff08RSA\uff09\u3002 -b 4096 \u6307\u5b9a\u5bc6\u94a5\u957f\u5ea6\uff08\u6bd4\u7279\uff09\u3002\u4f60\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u957f\u5ea6\u3002 \u6b65\u9aa4 3\uff1a\u8f93\u5165\u5bc6\u7801\uff08\u53ef\u9009\uff09 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-21647","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=21647"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21647\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}