{"id":20194,"date":"2024-11-19T16:43:43","date_gmt":"2024-11-19T08:43:43","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20194\/"},"modified":"2024-11-19T16:43:43","modified_gmt":"2024-11-19T08:43:43","slug":"ssh%e7%99%bb%e5%bd%95gitlab%e8%a6%81%e8%be%93%e5%85%a5%e7%9a%84%e5%af%86%e7%a0%81%e6%98%af%e4%bb%80%e4%b9%88","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20194\/","title":{"rendered":"ssh\u767b\u5f55gitlab\u8981\u8f93\u5165\u7684\u5bc6\u7801\u662f\u4ec0\u4e48"},"content":{"rendered":"<p>ssh\u767b\u5f55gitlab\u8981\u8f93\u5165\u7684\u5bc6\u7801\u662f\u6bcf\u4e2a\u7528\u6237\u81ea\u5df1\u7684\u5bc6\u7801\uff0c\u8fd9\u4e2a\u5bc6\u7801\u662f\u7528\u6237\u5728\u6ce8\u518cgitlab\u8d26\u53f7\u65f6\u8bbe\u7f6e\u7684\u767b\u5f55\u5bc6\u7801\u3002<\/p>\n<p>GitLab\u662f\u4e00\u6b3e\u975e\u5e38\u6d41\u884c\u7684\u5f00\u6e90\u4ee3\u7801\u6258\u7ba1\u5e73\u53f0\uff0c\u652f\u6301Git\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u56e2\u961f\u534f\u4f5c\u5f00\u53d1\u3002\u5728\u4f7f\u7528GitLab\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7SSH\u534f\u8bae\u6765\u8fdb\u884c\u5b89\u5168\u7684\u8fdc\u7a0b\u767b\u5f55\u548c\u4ee3\u7801\u4f20\u8f93\u3002\u800c\u8981\u4f7f\u7528SSH\u767b\u5f55GitLab\uff0c\u9700\u8981\u5728GitLab\u8d26\u53f7\u4e2d\u8bbe\u7f6eSSH\u516c\u94a5\uff0c\u4ee5\u786e\u4fdd\u6211\u4eec\u7684\u8eab\u4efd\u548c\u5b89\u5168\u6027\u3002<\/p>\n<p>\u5728\u8bbe\u7f6e\u4e86SSH\u516c\u94a5\u7684\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528SSH\u547d\u4ee4\u6765\u767b\u5f55GitLab\uff0c\u547d\u4ee4\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre>ssh username@gitlab.com<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2d\uff0cusername\u662f\u4f60\u5728GitLab\u4e0a\u7684\u8d26\u6237\u540d\u3002\u5728\u8f93\u5165\u5b8c\u8fd9\u4e2a\u547d\u4ee4\u4e4b\u540e\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u4f60\u8f93\u5165\u5bc6\u7801\u3002\u8fd9\u4e2a\u5bc6\u7801\u5c31\u662f\u4f60\u5728\u6ce8\u518cGitLab\u8d26\u53f7\u65f6\u8bbe\u7f6e\u7684\u767b\u5f55\u5bc6\u7801\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cGitLab\u4f7f\u7528\u7684\u662f\u5bc6\u7801\u9a8c\u8bc1\u65b9\u5f0f\uff0c\u800c\u4e0d\u662fSSH\u5bc6\u94a5\u9a8c\u8bc1\u65b9\u5f0f\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53\u6211\u4eec\u4f7f\u7528SSH\u767b\u5f55GitLab\u65f6\uff0c\u9700\u8981\u8f93\u5165\u7528\u6237\u7684\u5bc6\u7801\uff0c\u800c\u4e0d\u662fSSH\u5bc6\u94a5\u5bc6\u7801\u3002<\/p>\n<p>\u4e3a\u4e86\u4fdd\u969c\u5b89\u5168\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e9b\u63aa\u65bd\u6765\u589e\u52a0\u5bc6\u7801\u7684\u5f3a\u5ea6\uff0c\u4f8b\u5982\u4f7f\u75288\u4f4d\u6216\u66f4\u957f\u7684\u5bc6\u7801\uff0c\u5305\u542b\u6570\u5b57\u3001\u5c0f\u5199\u5b57\u6bcd\u3001\u5927\u5199\u5b57\u6bcd\u548c\u7279\u6b8a\u5b57\u7b26\u7b49\u3002\u540c\u65f6\uff0c\u8fd8\u53ef\u4ee5\u542f\u7528GitLab\u7684\u53cc\u56e0\u7d20\u8ba4\u8bc1\u529f\u80fd\uff0c\u5373\u4f7f\u5bc6\u7801\u88ab\u6cc4\u9732\u4e5f\u80fd\u4fdd\u969c\u8d26\u6237\u7684\u5b89\u5168\u6027\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u5728\u4f7f\u7528SSH\u767b\u5f55GitLab\u65f6\uff0c\u6211\u4eec\u9700\u8981\u8f93\u5165\u7684\u5bc6\u7801\u662f\u6bcf\u4e2a\u7528\u6237\u81ea\u5df1\u7684\u5bc6\u7801\uff0c\u8fd9\u4e2a\u5bc6\u7801\u662f\u7528\u6237\u5728\u6ce8\u518cGitLab\u8d26\u53f7\u65f6\u8bbe\u7f6e\u7684\u767b\u5f55\u5bc6\u7801\u3002\u4e3a\u4e86\u4fdd\u969c\u8d26\u6237\u548c\u4ee3\u7801\u7684\u5b89\u5168\uff0c\u6211\u4eec\u9700\u8981\u589e\u5f3a\u5bc6\u7801\u5f3a\u5ea6\uff0c\u5e76\u542f\u7528\u53cc\u56e0\u7d20\u8ba4\u8bc1\u7b49\u63aa\u65bd\uff0c\u4ee5\u63d0\u9ad8\u8d26\u6237\u548c\u4ee3\u7801\u7684\u5b89\u5168\u6027\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fssh\u767b\u5f55gitlab\u8981\u8f93\u5165\u7684\u5bc6\u7801\u662f\u4ec0\u4e48\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>ssh\u767b\u5f55gitlab\u8981\u8f93\u5165\u7684\u5bc6\u7801\u662f\u6bcf\u4e2a\u7528\u6237\u81ea\u5df1\u7684\u5bc6\u7801\uff0c\u8fd9\u4e2a\u5bc6\u7801\u662f\u7528\u6237\u5728\u6ce8\u518cgitlab\u8d26\u53f7\u65f6\u8bbe\u7f6e\u7684\u767b\u5f55\u5bc6\u7801\u3002 GitLab\u662f\u4e00\u6b3e\u975e\u5e38\u6d41\u884c\u7684\u5f00\u6e90\u4ee3\u7801\u6258\u7ba1\u5e73\u53f0\uff0c\u652f\u6301Git\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u56e2\u961f\u534f\u4f5c\u5f00\u53d1\u3002\u5728\u4f7f\u7528GitLab\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7SSH\u534f\u8bae\u6765\u8fdb\u884c\u5b89\u5168\u7684\u8fdc\u7a0b\u767b\u5f55\u548c\u4ee3\u7801\u4f20\u8f93\u3002\u800c\u8981\u4f7f\u7528SSH\u767b\u5f55GitLab\uff0c\u9700\u8981\u5728GitLab\u8d26\u53f7\u4e2d\u8bbe\u7f6eSSH\u516c\u94a5\uff0c\u4ee5\u786e\u4fdd\u6211\u4eec\u7684\u8eab\u4efd\u548c\u5b89\u5168\u6027\u3002 \u5728\u8bbe\u7f6e\u4e86SSH\u516c\u94a5\u7684\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528SSH\u547d\u4ee4\u6765\u767b\u5f55GitLab\uff0c\u547d\u4ee4\u683c\u5f0f\u5982\u4e0b\uff1a ssh username@gitlab.com \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0cusername\u662f\u4f60\u5728GitLab\u4e0a\u7684\u8d26\u6237\u540d\u3002\u5728\u8f93\u5165\u5b8c\u8fd9\u4e2a\u547d\u4ee4\u4e4b\u540e\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u4f60\u8f93\u5165\u5bc6\u7801\u3002\u8fd9\u4e2a\u5bc6\u7801\u5c31\u662f\u4f60\u5728\u6ce8\u518cGitLab\u8d26\u53f7\u65f6\u8bbe\u7f6e\u7684\u767b\u5f55\u5bc6\u7801\u3002 \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cGitLab\u4f7f\u7528\u7684\u662f\u5bc6\u7801\u9a8c\u8bc1\u65b9\u5f0f\uff0c\u800c\u4e0d\u662fSSH\u5bc6\u94a5\u9a8c\u8bc1\u65b9\u5f0f\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53\u6211\u4eec\u4f7f\u7528SSH\u767b\u5f55GitLab\u65f6\uff0c\u9700\u8981\u8f93\u5165\u7528\u6237\u7684\u5bc6\u7801\uff0c\u800c\u4e0d\u662fSSH\u5bc6\u94a5\u5bc6\u7801\u3002 \u4e3a\u4e86\u4fdd\u969c\u5b89\u5168\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e9b\u63aa\u65bd\u6765\u589e\u52a0\u5bc6\u7801\u7684\u5f3a\u5ea6\uff0c\u4f8b\u5982\u4f7f\u75288\u4f4d\u6216\u66f4\u957f\u7684\u5bc6\u7801\uff0c\u5305\u542b\u6570\u5b57\u3001\u5c0f\u5199\u5b57\u6bcd\u3001\u5927\u5199\u5b57\u6bcd\u548c\u7279\u6b8a\u5b57\u7b26\u7b49\u3002\u540c\u65f6\uff0c\u8fd8\u53ef\u4ee5\u542f\u7528GitLab\u7684\u53cc\u56e0\u7d20\u8ba4\u8bc1\u529f\u80fd\uff0c\u5373\u4f7f\u5bc6\u7801\u88ab\u6cc4\u9732\u4e5f\u80fd\u4fdd\u969c\u8d26\u6237\u7684\u5b89\u5168\u6027\u3002 \u603b\u4e4b\uff0c\u5728\u4f7f\u7528SSH\u767b\u5f55GitLab\u65f6\uff0c\u6211\u4eec\u9700\u8981\u8f93\u5165\u7684\u5bc6\u7801\u662f\u6bcf\u4e2a\u7528\u6237\u81ea\u5df1\u7684\u5bc6\u7801\uff0c\u8fd9\u4e2a\u5bc6\u7801\u662f\u7528\u6237\u5728\u6ce8\u518cGitLab\u8d26\u53f7\u65f6\u8bbe\u7f6e\u7684\u767b\u5f55\u5bc6\u7801\u3002\u4e3a\u4e86\u4fdd\u969c\u8d26\u6237\u548c\u4ee3\u7801\u7684\u5b89\u5168\uff0c\u6211\u4eec\u9700\u8981\u589e\u5f3a\u5bc6\u7801\u5f3a\u5ea6\uff0c\u5e76\u542f\u7528\u53cc\u56e0\u7d20\u8ba4\u8bc1\u7b49\u63aa\u65bd\uff0c\u4ee5\u63d0\u9ad8\u8d26\u6237\u548c\u4ee3\u7801\u7684\u5b89\u5168\u6027\u3002 \u4ee5\u4e0a\u5c31\u662fssh\u767b\u5f55gitlab\u8981\u8f93\u5165\u7684\u5bc6\u7801\u662f\u4ec0\u4e48\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-20194","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20194","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=20194"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20194\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}