{"id":3199,"date":"2025-12-27T14:08:11","date_gmt":"2025-12-27T05:08:11","guid":{"rendered":"https:\/\/www.blowfish.co.jp\/?p=3199"},"modified":"2025-12-27T14:08:11","modified_gmt":"2025-12-27T05:08:11","slug":"macos%e3%81%a7github-ssh%e6%8e%a5%e7%b6%9a%e3%81%8c%e5%86%8d%e8%b5%b7%e5%8b%95%e5%be%8c%e3%81%ab%e5%88%87%e3%82%8c%e3%82%8b%e5%95%8f%e9%a1%8c%e3%81%a8%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=3199","title":{"rendered":"macOS\u3067GitHub SSH\u63a5\u7d9a\u304c\u518d\u8d77\u52d5\u5f8c\u306b\u5207\u308c\u308b\u554f\u984c\u3068\u89e3\u6c7a\u65b9\u6cd5"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u73fe\u8c61<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>git fetch &#91;1330ms]\n&#91;info] git@github.com: Permission denied (publickey).\nfatal: Could not read from remote repository.\nPlease make sure you have the correct access rights\nand the repository exists.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u554f\u984c<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4ee5\u524d\u306f\u63a5\u7d9a\u3067\u304d\u3066\u3044\u305f\u306e\u306b\u3001\u7a81\u7136\u300cPermission denied (publickey)\u300d\u30a8\u30e9\u30fc\u304c\u767a\u751f<\/li>\n\n\n\n<li>macOS\u3067\u306f\u518d\u8d77\u52d5\u5f8c\u306bssh-agent\u3078\u306eSSH\u9375\u767b\u9332\u304c\u6d88\u3048\u308b<\/li>\n\n\n\n<li>\u6bce\u56de<code>ssh-add<\/code>\u30b3\u30de\u30f3\u30c9\u3067\u9375\u3092\u518d\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u539f\u56e0<\/h2>\n\n\n\n<p>macOS\u306essh-agent\u306f\u518d\u8d77\u52d5\u6642\u306b\u30e1\u30e2\u30ea\u4e0a\u306e\u9375\u60c5\u5831\u3092\u30af\u30ea\u30a2\u3059\u308b\u305f\u3081\u3001SSH\u9375\u306e\u767b\u9332\u304c\u5931\u308f\u308c\u308b<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u6c7a\u65b9\u6cd5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. SSH\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u30fb\u7de8\u96c6<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>nano ~\/.ssh\/config\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. GitHub\u5c02\u7528\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Host github.com\n  HostName github.com\n  User git\n  AddKeysToAgent yes\n  UseKeychain yes\n  IdentityFile ~\/.ssh\/id_rsa_github\n<\/code><\/pre>\n\n\n\n<p><strong>\u8a2d\u5b9a\u306e\u610f\u5473:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>AddKeysToAgent yes<\/code> &#8211; \u81ea\u52d5\u7684\u306bssh-agent\u306b\u9375\u3092\u8ffd\u52a0<\/li>\n\n\n\n<li><code>UseKeychain yes<\/code> &#8211; macOS\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306b\u9375\u60c5\u5831\u3092\u4fdd\u5b58<\/li>\n\n\n\n<li><code>IdentityFile<\/code> &#8211; \u4f7f\u7528\u3059\u308b\u79d8\u5bc6\u9375\u306e\u30d1\u30b9\u3092\u6307\u5b9a<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u9375\u3092macOS\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306b\u767b\u9332<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-add --apple-use-keychain ~\/.ssh\/id_rsa_github\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u63a5\u7d9a\u78ba\u8a8d<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -T git@github.com\n<\/code><\/pre>\n\n\n\n<p>\u6210\u529f\u30e1\u30c3\u30bb\u30fc\u30b8: <code>Hi username! You've successfully authenticated...<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u52b9\u679c<\/h2>\n\n\n\n<p>\u3053\u306e\u8a2d\u5b9a\u306b\u3088\u308a\u3001\u518d\u8d77\u52d5\u5f8c\u3082\u81ea\u52d5\u7684\u306bmacOS\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u304b\u3089\u9375\u60c5\u5831\u304c\u8aad\u307f\u8fbc\u307e\u308c\u3001\u624b\u52d5\u3067<code>ssh-add<\/code>\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73fe\u8c61 \u554f\u984c \u539f\u56e0 macOS\u306essh-agent\u306f\u518d\u8d77\u52d5\u6642\u306b\u30e1\u30e2\u30ea\u4e0a\u306e\u9375\u60c5\u5831\u3092\u30af\u30ea\u30a2\u3059\u308b\u305f\u3081\u3001SSH\u9375\u306e\u767b\u9332\u304c\u5931\u308f\u308c\u308b \u89e3\u6c7a\u65b9\u6cd5 1. SSH\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u30fb\u7de8\u96c6 2. GitHub\u5c02\u7528\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0 \u8a2d\u5b9a\u306e\u610f\u5473: 3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[24,88,4],"tags":[],"class_list":["post-3199","post","type-post","status-publish","format-standard","hentry","category-git","category-kiro","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/3199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3199"}],"version-history":[{"count":1,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/3199\/revisions"}],"predecessor-version":[{"id":3200,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/3199\/revisions\/3200"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}