{"id":153,"date":"2025-11-13T20:30:12","date_gmt":"2025-11-13T12:30:12","guid":{"rendered":"http:\/\/180.76.113.73:8080\/?p=153"},"modified":"2025-11-13T20:35:14","modified_gmt":"2025-11-13T12:35:14","slug":"%e4%b8%80%e5%8f%b0%e7%94%b5%e8%84%91%e9%85%8d%e7%bd%ae%e5%a4%9a%e4%b8%aa%e8%bf%9c%e7%a8%8b%e4%bb%93%e5%ba%93ssh%e5%af%86%e9%92%a5","status":"publish","type":"post","link":"https:\/\/www.windafterglow.cn\/index.php\/2025\/11\/13\/%e4%b8%80%e5%8f%b0%e7%94%b5%e8%84%91%e9%85%8d%e7%bd%ae%e5%a4%9a%e4%b8%aa%e8%bf%9c%e7%a8%8b%e4%bb%93%e5%ba%93ssh%e5%af%86%e9%92%a5\/","title":{"rendered":"\u4e00\u53f0\u7535\u8111\u914d\u7f6e\u591a\u4e2a\u8fdc\u7a0b\u4ed3\u5e93SSH\u5bc6\u94a5"},"content":{"rendered":"<p>\u505a\u4e00\u4e2a\u8bb0\u5f55\uff0c\u5173\u4e8e\u5982\u4f55\u5728\u4e00\u53f0\u7535\u8111\u4e0a\u540c\u65f6\u914d\u7f6e\u591a\u4e2a\u4ed3\u5e93\u8d26\u53f7\uff0c\u6bd4\u5982\u6211Gitee\u548cGithub\u4e0d\u662f\u540c\u4e00\u4e2a\u8d26\u53f7\uff0c\u4f46\u662f\u6211\u60f3\u540c\u65f6\u5728\u4e00\u4e2a\u7535\u8111\u4e0a\u5f00\u53d1\u8fd9\u4e24\u4e2a\u4ed3\u5e93\u7684\u9879\u76ee\uff0c\u600e\u4e48\u529e\uff1f<\/p>\n<p>\u867d\u7136\u53ef\u4ee5\u901a\u8fc7\u5207\u6362\u8d26\u53f7\u6216\u8005\u4e3a\u5355\u72ec\u7684\u4ed3\u5e93\u8bbe\u7f6e\u4e13\u6709\u8d26\u53f7\u6765\u5b9e\u73b0\uff0c\u4f46\u8fd8\u662f\u6709\u4e9b\u9ebb\u70e6\u3002<\/p>\n<p>\u73b0\u5728\u5c31\u6709\u4e00\u4e2a\u65b9\u6cd5\uff0c\u6765\u89e3\u51b3\u4e0a\u8ff0\u95ee\u9898\uff1a\u7ed9\u4e00\u53f0\u7535\u8111\u914d\u7f6e\u591a\u4e2aSSH\u5bc6\u94a5\uff0c\u6bcf\u4e2a\u5bc6\u94a5\u5355\u72ec\u914d\u5bf9\u5bf9\u5e94\u7684\u4ed3\u5e93\u7f51\u7ad9\u3002<\/p>\n<h3 class=\"wp-block-heading\"> \u751f\u6210SSH\u5bc6\u94a5\u5bf9<\/h3>\n<p>\u8fd9\u91cc\u4ee5Gitee\u548cGithub\u4e3a\u4f8b\uff0c\u5148\u751f\u6210\u5bc6\u94a5\u5bf9<\/p>\n<pre><code class=\"lang-shell language-shell shell\">#\u4e3aGitee\u8d26\u53f7\u751f\u6210\u5bc6\u94a5\nssh-keygen -t rsa -C &quot;\u4f60\u7684gitee\u90ae\u7bb1@example.com&quot;\n#\u4e3aGitHub\u8d26\u53f7\u751f\u6210\u5bc6\u94a5\nssh-keygen -t rsa -C &quot;\u4f60\u7684github\u90ae\u7bb1@example.com&quot;<\/code><\/pre>\n<figure id=\"attachment_mmd_159\" class=\"wp-block-image alignnone\"><img decoding=\"async\" width=\"1392\" height=\"543\" data-src=\"https:\/\/www.windafterglow.cn\/wp-content\/uploads\/2025\/11\/1763036900-5_1.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@3.0\/basic\/puff-load.svg\" onerror=\"imgError(this)\" class=\"attachment-3000x1170 size-3000x1170 lazyload\" alt=\"1763036900-5_1\" loading=\"lazy\" align=\"none\" \/><noscript><img decoding=\"async\" width=\"1392\" height=\"543\" src=\"https:\/\/www.windafterglow.cn\/wp-content\/uploads\/2025\/11\/1763036900-5_1.png\" class=\"attachment-3000x1170 size-3000x1170\" alt=\"1763036900-5_1\" loading=\"lazy\" align=\"none\" \/><\/noscript><\/figure>\n<h3 class=\"wp-block-heading\"> \u6dfb\u52a0\u516c\u94a5\u5230\u5bf9\u5e94\u5e73\u53f0<\/h3>\n<p>\u5b8c\u6210\u4e0a\u4e00\u6b65\u540e\uff0c\u4f1a\u5f97\u5230\u4e24\u5bf9\u79c1\u94a5\u548c\u516c\u94a5\uff0c\u4f8b\u5982 <code>id_rsa_gitee<\/code>\u3001<code>id_rsa_gitee.pub<\/code>\u3001<code>id_rsa_github<\/code>\u3001<code>id_rsa_github.pub<\/code>\u3002<\/p>\n<p>\u9700\u8981\u5206\u522b\u5c06\u540e\u7f00\u4e3a <code>.pub<\/code> \u7684\u516c\u94a5\u6587\u4ef6\u5185\u5bb9\u6dfb\u52a0\u5230Gitee\u548cGitHub\u7684\u8d26\u6237\u8bbe\u7f6e\u4e2d\u3002<\/p>\n<ul>\n<li><strong>Gitee<\/strong>: \u767b\u5f55\u540e\uff0c\u5728<strong>\u8bbe\u7f6e<\/strong>\u4e2d\u627e\u5230 <strong>SSH\u516c\u94a5<\/strong> \u7ba1\u7406\u9875\u9762\uff0c\u6dfb\u52a0\u5185\u5bb9\u3002<\/li>\n<li><strong>GitHub<\/strong>: \u767b\u5f55\u540e\uff0c\u5728 <strong>Settings<\/strong> \u4e2d\u627e\u5230 <strong>SSH and GPG keys<\/strong> \u9875\u9762\uff0c\u6dfb\u52a0\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">\u521b\u5efaSSH\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u5728\u4f60\u521a\u521a\u521b\u5efa\u5bc6\u94a5\u7684\u6587\u4ef6\u5185\uff0c\u521b\u5efa<code>config<\/code>\u7684\u6587\u4ef6\uff0c\u65e0\u540e\u7f00\uff0c\u7136\u540e\u7528\u6587\u672c\u7f16\u8f91\u5668\u7f16\u8f91\uff0c\u586b\u5199\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><code class=\"lang-bash language-bash bash\"># Gitee \u8d26\u53f7\u914d\u7f6e\nHost gitee.com\n    HostName gitee.com\n    PreferredAuthentications publickey\n    IdentityFile ~\/.ssh\/id_rsa_gitee_PC  # \u8fd9\u91cc\u586b\u5199\u4f60\u7684Gitee\u79c1\u94a5\u6587\u4ef6\u8def\u5f84\n\n# GitHub \u8d26\u53f7\u914d\u7f6e\nHost github.com\n    HostName github.com\n    PreferredAuthentications publickey\n    IdentityFile ~\/.ssh\/id_rsa_github_PC # \u8fd9\u91cc\u586b\u5199\u4f60\u7684GitHub\u79c1\u94a5\u6587\u4ef6\u8def\u5f84<\/code><\/pre>\n<p>\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u7684\u4f5c\u7528\u662f\uff1a\u5f53\u4f60\u8bbf\u95ee <code>gitee.com<\/code> \u65f6\uff0cGit\u4f1a\u81ea\u52a8\u4f7f\u7528 <code>id_rsa_gitee<\/code> \u79c1\u94a5\uff1b\u5f53\u4f60\u8bbf\u95ee <code>github.com<\/code> \u65f6\uff0c\u5219\u4f1a\u4f7f\u7528 <code>id_rsa_github<\/code> \u79c1\u94a5\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u6d4b\u8bd5\u8fde\u63a5<\/h3>\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e2d\u6d4b\u8bd5\u662f\u5426\u6210\u529f\u3002<\/p>\n<pre><code class=\"lang-bash language-bash bash\">ssh -T git@gitee.com\nssh -T git@github.com<\/code><\/pre>\n<figure id=\"attachment_mmd_158\" class=\"wp-block-image alignnone\"><img decoding=\"async\" width=\"1614\" height=\"195\" data-src=\"https:\/\/www.windafterglow.cn\/wp-content\/uploads\/2025\/11\/1763036900-5_2.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@3.0\/basic\/puff-load.svg\" onerror=\"imgError(this)\" class=\"attachment-3000x360 size-3000x360 lazyload\" alt=\"1763036900-5_2\" loading=\"lazy\" align=\"none\" \/><noscript><img decoding=\"async\" width=\"1614\" height=\"195\" src=\"https:\/\/www.windafterglow.cn\/wp-content\/uploads\/2025\/11\/1763036900-5_2.png\" class=\"attachment-3000x360 size-3000x360\" alt=\"1763036900-5_2\" loading=\"lazy\" align=\"none\" \/><\/noscript><\/figure>\n<p>\u51fa\u73b0\u8fd9\u6837\u7684\u8f93\u51fa\uff0c\u5c31\u4ee3\u8868\u8fde\u63a5\u6210\u529f\u4e86\uff01<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u53ea\u9700\u8981\u5230\u8fdc\u7a0b\u4ed3\u5e93\u91cc\u4f7f\u7528SSH\u8fdb\u884cClone\u5c31\u884c\u4e86\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>\u505a\u4e00\u4e2a\u8bb0\u5f55\uff0c\u5173\u4e8e\u5982\u4f55\u5728\u4e00\u53f0\u7535\u8111\u4e0a\u540c\u65f6\u914d\u7f6e\u591a\u4e2a\u4ed3\u5e93\u8d26\u53f7\uff0c\u6bd4\u5982\u6211Gitee\u548cGithub\u4e0d\u662f\u540c\u4e00\u4e2a\u8d26\u53f7\uff0c\u4f46\u662f\u6211\u60f3\u540c\u65f6\u5728\u4e00\u4e2a\u7535\u8111\u4e0a\u5f00\u53d1\u8fd9 &#8230;<\/p>","protected":false},"author":1,"featured_media":164,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[1],"tags":[10],"class_list":["post-153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1","tag-git"],"_links":{"self":[{"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":7,"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/posts\/153\/revisions\/163"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/media\/164"}],"wp:attachment":[{"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.windafterglow.cn\/index.php\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}