{"id":268,"date":"2016-07-28T09:03:54","date_gmt":"2016-07-28T09:03:54","guid":{"rendered":"http:\/\/blog.chen-hongyi.com\/?p=268"},"modified":"2016-08-15T07:49:27","modified_gmt":"2016-08-15T07:49:27","slug":"use-passpahrse-in-ssh-with-forwordagent","status":"publish","type":"post","link":"https:\/\/chen-hongyi.com\/?p=268","title":{"rendered":"use passpahrse in ssh with ForwordAgent"},"content":{"rendered":"<p>\u91cd\u542f\u673a\u5668\u540e\uff0c\u53d1\u73b0\u672c\u6765\u7b49\u4e8e\u8fdc\u7a0b\u53ef\u4ee5git checkout\u7684\uff32\uff45\uff50\uff4f\u62a5\u544a\u8bf4<\/p>\n<blockquote><p>fatal: Could not read from remote repository.<\/p>\n<p>Please make sure you have the correct access rights<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u56e0\u4e3a\u662f\u7528\u672c\u5730\u7684forward useragent \u7684.\u4f30\u8ba1\u662f\u672c\u5730\u7684key\u6ca1\u6709\u88ab\u52a0\u5165user agent.\u6240\u4ee5\u67e5\u770b\u672c\u5730\u7684 agent.<\/p>\n<p>\u9996\u5148\u67e5\u770bkey\u662f\u4e0d\u662f\u7ed9agent\u7ba1\u7406\u4e86?<\/p>\n<pre>ssh-add -L<\/pre>\n<p>\u679c\u7136\u8fd4\u56de<\/p>\n<pre>The agent has no identities.<\/pre>\n<p>\u679c\u7136\u6ca1\u6709\u88ab\u7ba1\u7406. \u7136\u540e\u7528ssh-add mykey<\/p>\n<pre class=\"command-line\"><span class=\"command\">ssh-add <em>yourkey<\/em><\/span><\/pre>\n<p>\u5c31\u628a\u81ea\u5df1\u7684key\u52a0\u5165\u7684\u94a5\u5319\u4e32(\u82f9\u679c\u91cc\u53eb\u8fd9\u4e2a)\u4e86.\u7136\u540e\u5728\u767b\u9646\u8fdc\u7a0b,\u5c31\u80fd\u987a\u5229checkout\u4e86.<\/p>\n<p>&nbsp;<\/p>\n<p>if the private key is protected with passpharse, before use ssh with forwordAgent, you need to use<\/p>\n<blockquote><p>ssh-add YourPassparse<\/p><\/blockquote>\n<p>to add\/store the passparse.<\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4e8eSSH Key\u7ba1\u7406\u8bb2\u89e3\u7684\u6bd4\u8f83\u6e05\u65b0 \u3002\u5efa\u8bae\u9605\u8bfb\u3002 <a href=\"https:\/\/wiki.archlinux.org\/index.php\/SSH_keys_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)\">\u94fe\u63a5<\/a>\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u542f\u673a\u5668\u540e\uff0c\u53d1\u73b0\u672c\u6765\u7b49\u4e8e\u8fdc\u7a0b\u53ef\u4ee5git checkout\u7684\uff32\uff45\uff50\uff4f\u62a5\u544a\u8bf4 fat &hellip; <a href=\"https:\/\/chen-hongyi.com\/?p=268\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-268","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=268"}],"version-history":[{"count":5,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/268\/revisions"}],"predecessor-version":[{"id":277,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/268\/revisions\/277"}],"wp:attachment":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}