{"id":2835,"date":"2023-11-21T23:40:22","date_gmt":"2023-11-21T15:40:22","guid":{"rendered":"http:\/\/www.iooe.cn\/?p=2835"},"modified":"2023-11-21T23:40:22","modified_gmt":"2023-11-21T15:40:22","slug":"macos-big-sur-%e7%b3%bb%e7%bb%9f%e4%b8%8b%e8%ae%bf%e9%97%aessh-%e5%af%86%e5%8c%99%e4%b8%8d%e5%90%af%e4%bd%9c%e7%94%a8-https-gitcode-net-ssh-key%e5%a4%b1%e6%95%88","status":"publish","type":"post","link":"http:\/\/www.iooe.cn\/index.php\/2023\/11\/21\/macos-big-sur-%e7%b3%bb%e7%bb%9f%e4%b8%8b%e8%ae%bf%e9%97%aessh-%e5%af%86%e5%8c%99%e4%b8%8d%e5%90%af%e4%bd%9c%e7%94%a8-https-gitcode-net-ssh-key%e5%a4%b1%e6%95%88\/","title":{"rendered":"macos big sur \u7cfb\u7edf\u4e0b\u8bbf\u95eessh \u5bc6\u5319\u4e0d\u542f\u4f5c\u7528 https:\/\/gitcode.net ssh-key\u5931\u6548"},"content":{"rendered":"\n<p>\u672c\u5730\u4e0a\u4f20\u4ee3\u7801\u65f6\uff0c\u6267\u884c\u547d\u4ee4\uff1agit push -u origin master\u9047\u5230\u4e0b\u9762\u9519\u8bef\u63d0\u793a<br>gitt@github.com: Permission denied (publickey).<br>fatal: Could not read from remote repository<br>\u8f6c\u81ea\uff1a\u539f\u6587\u3002<\/p>\n\n\n\n<p>\u539f\u56e0\u4e3a\u672c\u5730(\u6216\u8005\u670d\u52a1\u5668)\u6ca1\u6709\u751f\u6210ssh key<\/p>\n\n\n\n<p>\u5728\u7ec8\u7aef\u6267\u884ccd ~\/.ssh ls\u6765\u67e5\u770b\u662f\u5426\u6709\u6587\u4ef6id_rsa\u4ee5\u53ca\u6587\u4ef6id_rsa.pub\uff0c\u5982\u4e0b\u56fe\u6240\u793a<\/p>\n\n\n\n<p>\u672c\u5730\u6ca1\u6709id_rsa.pub<\/p>\n\n\n\n<p>\u4e0b\u9762\u8bb0\u5f55\u4e0b\u89e3\u51b3\u529e\u6cd5\uff1a<br>\u3000\u30001.\u9996\u5148\uff0c\u5982\u679c\u4f60\u6ca1\u6709ssh key\u7684\u8bdd\uff0c\u5728ternimal\u4e0b\u8f93\u5165\u547d\u4ee4\uff1a<\/p>\n\n\n\n<p>ssh-keygen -t rsa -C &#8220;jff1314@126.com&#8221;<br>1<br>jff1314@126.com\u6539\u4e3a\u81ea\u5df1\u7684\u90ae\u7bb1\u5373\u53ef\uff0c\u9014\u4e2d\u4f1a\u8ba9\u4f60\u8f93\u5165\u5bc6\u7801\u5565\u7684(\u53ef\u4e3a\u7a7a)\uff0c\u4e0d\u9700\u8981\u7ba1\uff0c\u4e00\u8def\u56de\u8f66\u5373\u53ef\uff0c\u4f1a\u751f\u6210\u4f60\u7684ssh key\u3002\uff08\u5982\u679c\u91cd\u65b0\u751f\u6210\u7684\u8bdd\u4f1a\u8986\u76d6\u4e4b\u524d\u7684ssh key\u3002\uff09<\/p>\n\n\n\n<p>2.\u7136\u540e\u518dternimal\u4e0b\u6267\u884c\u547d\u4ee4\uff1a<\/p>\n\n\n\n<p>ssh -v git@github.com<br>1<br>\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e0b\u9762\u9519\u8bef\u4fe1\u606f<\/p>\n\n\n\n<p>3.\u8fd9\u65f6\u5019\u518d\u5728ternimal\u4e0b\u8f93\u5165\uff1a<\/p>\n\n\n\n<p>ssh-agent -s<br>1<br>\u7136\u540e\u4f1a\u63d0\u793a\u7c7b\u4f3c\u7684\u4fe1\u606f\uff1a<\/p>\n\n\n\n<p>SSH_AUTH_SOCK=\/var\/folders\/j6\/qwcj2wxj0bnbs52vzb0yp2yc0000gn\/T\/\/ssh-btKdCCbrn5uD\/agent.6711; export SSH_AUTH_SOCK;<br>SSH_AGENT_PID=6712; export SSH_AGENT_PID;<br>echo Agent pid 6712;<\/p>\n\n\n\n<p>4.\u63a5\u7740\u518d\u8f93\u5165\uff1a<\/p>\n\n\n\n<p>ssh-add ~\/.ssh\/id_rsa<br>1<br>\u8fd9\u65f6\u5019\u5e94\u8be5\u4f1a\u63d0\u793a\uff1a<\/p>\n\n\n\n<p>Identity added: \/Users\/xieliping\/.ssh\/id_rsa (jff1314@126.com)\uff08\u8fd9\u91cc\u662f\u4e00\u4e9bssh key\u6587\u4ef6\u8def\u5f84\u7684\u4fe1\u606f\uff09<\/p>\n\n\n\n<p>5.\u6267\u884cid_rsa.pub\u8def\u5f84 \u67e5\u627e\u91cc\u9762\u7684\u5185\u5bb9\uff0c\u590d\u5236ssh-rsa \u91cc\u9762\u7684\u5185\u5bb9<\/p>\n\n\n\n<p>cat \/Users\/xieliping\/.ssh\/id_rsa.pub<br>1<br>\uff08\u6ce8\u610f\uff09\u5982\u679c\u51fa\u73b0\u9519\u8bef\u63d0\u793a\uff1a<\/p>\n\n\n\n<p>Could not open a connection to your authentication agent.<\/p>\n\n\n\n<p>\u8bf7\u6267\u884c\u547d\u4ee4\uff1aeval ssh-agent -s\u540e\u7ee7\u7eed\u6267\u884c\u547d\u4ee4 ssh-add ~\/.ssh\/id_rsa\uff0c\u8fd9\u65f6\u5019\u4e00\u822c\u6ca1\u95ee\u9898\u5566\u3002<\/p>\n\n\n\n<p>5.\u6253\u5f00\u4f60\u521a\u521a\u751f\u6210\u7684id_rsa.pub\uff0c\u5c06\u91cc\u9762\u7684\u5185\u5bb9\u590d\u5236\uff0c\u8fdb\u5165\u4f60\u7684github\u8d26\u53f7\uff0c\u5728settings\u4e0b\uff0cSSH and GPG keys\u4e0bnew SSH key\uff0ctitle\u968f\u4fbf\u53d6\u4e00\u4e2a\u540d\u5b57\uff0c\u7136\u540e\u5c06id_rsa.pub\u91cc\u7684\u5185\u5bb9\u590d\u5236\u5230Key\u4e2d\uff0c\u5b8c\u6210\u540eAdd SSH Key\u3002<\/p>\n\n\n\n<p>6.\u6700\u540e\u4e00\u6b65\uff0c\u9a8c\u8bc1Key<\/p>\n\n\n\n<p>\u5728ternimal\u4e0b\u8f93\u5165\u547d\u4ee4\uff1a<\/p>\n\n\n\n<p>ssh -T git@github.com<br>1<br>\u63d0\u793a\uff1a<br>Hi xxx! You\u2019ve successfully authenticated, but GitHub does not provide shell access.<\/p>\n\n\n\n<p>\u8fd9\u65f6\u5019\u95ee\u9898\u5c31\u89e3\u51b3\u5566\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4git push -u origin master\u4e0a\u4f20\u4ee3\u7801\u4e86\u3002<br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3aCSDN\u535a\u4e3b\u300c\u8001\u5b9e\u7537\u5927\u5b66\u751f\u300d\u7684\u539f\u521b\u6587\u7ae0\uff0c\u9075\u5faaCC 4.0 BY-SA\u7248\u6743\u534f\u8bae\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u539f\u6587\u51fa\u5904\u94fe\u63a5\u53ca\u672c\u58f0\u660e\u3002<br>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/blog.csdn.net\/weixin_44468956\/article\/details\/125293590<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u5730\u4e0a\u4f20\u4ee3\u7801\u65f6\uff0c\u6267\u884c\u547d\u4ee4\uff1agit push -u origin master\u9047\u5230\u4e0b\u9762\u9519\u8bef\u63d0\u793agitt@github.com: Permission denied&#8230; <\/p>\n<div class='button-mores'><a href='http:\/\/www.iooe.cn\/index.php\/2023\/11\/21\/macos-big-sur-%e7%b3%bb%e7%bb%9f%e4%b8%8b%e8%ae%bf%e9%97%aessh-%e5%af%86%e5%8c%99%e4%b8%8d%e5%90%af%e4%bd%9c%e7%94%a8-https-gitcode-net-ssh-key%e5%a4%b1%e6%95%88\/'> \u9605\u8bfb\u66f4\u591a&#8230; <\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"_links":{"self":[{"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/posts\/2835"}],"collection":[{"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2835"}],"version-history":[{"count":1,"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/posts\/2835\/revisions"}],"predecessor-version":[{"id":2836,"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/posts\/2835\/revisions\/2836"}],"wp:attachment":[{"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2835"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.iooe.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}