{"id":3853,"date":"2025-11-26T07:00:00","date_gmt":"2025-11-25T22:00:00","guid":{"rendered":"https:\/\/www.litcoder.com\/?p=3853"},"modified":"2025-11-19T15:53:11","modified_gmt":"2025-11-19T06:53:11","slug":"ssh-permission-denied-publickey","status":"publish","type":"post","link":"https:\/\/litcoder.com\/?p=3853","title":{"rendered":"SSH Permission denied (publickey)"},"content":{"rendered":"\n<p>\uc8fc\ub85c \uc2dc\uc2a4\ud15c\uc744 \uc124\uc815\ud558\ub294 \ucd08\uae30\uc5d0 \ubc1c\uc0dd\ud558\ub294 \ubb38\uc81c\uc778\ub370 private key\uac00 \uc81c\ub300\ub85c \uc788\uace0 file permission\ub3c4 \uc798 \uc124\uc815 \ub418\uc5b4 \uc788\uc74c\uc5d0\ub3c4 ssh \uc811\uc18d\uc744 \uc2dc\ub3c4\ud558\uba74 \uad8c\ud55c \uc624\ub958\uac00 \ubc1c\uc0dd\ud558\ub294 \uacbd\uc6b0\uac00 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ ssh -T git@github.com\ngit@github.com: Permission denied (publickey). <\/pre>\n\n\n\n<p>\ud574\uacb0\ud558\ub294 \ubc29\ubc95\uc740 \uc0ac\uc6a9\ud558\ub824\ub294 private key\ub97c ssh-add \uba85\ub839\uc5b4\ub97c \uc774\uc6a9\ud574\uc11c ssh-agent\uc5d0\uac8c \ucd94\uac00\ud574 \uc8fc\ub294 \uac83\uc778\ub370, \ub9cc\uc57d ssh-agent\uac00 \ub3d9\uc791\ud558\uc9c0 \uc54a\ub294 \uc0c1\ud0dc\ub77c\uba74 \uc774 \ub3d9\uc791\uc5d0\ub3c4 \uc624\ub958\uac00 \ubc1c\uc0dd\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ ssh-add ~\/.ssh\/my_private_key \nCould not open a connection to your authentication agent.<\/pre>\n\n\n\n<p>\uc774\uc640 \uac19\uc740 \uc778\uc99d agent \uad00\ub828\ud55c \ubb38\uc81c\uac00 \uc0dd\uae38 \ub54c\ub294 ssh-agent\ub97c \uc2e4\ud589\ud574\uc11c \ub098\uc624\ub294 \uacb0\uacfc\ubb3c\uc744 \ud654\uba74\uc5d0 \ubd99\uc5ec \ub123\uc73c\uba74 \ub41c\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># SSH-agent\ub97c \uc2e4\ud589\ud558\uba74 \ud658\uacbd\ubcc0\uc218 \uac12\ub4e4\uc774 \ud654\uba74\uc5d0 \ucd9c\ub825\ub41c\ub2e4.\n$ ssh-agent\nSSH_AUTH_SOCK=\/tmp\/ssh-GWQEJqNDZHsI\/agent.3260; export SSH_AUTH_SOCK;\nSSH_AGENT_PID=3261; export SSH_AGENT_PID;\necho Agent pid 3261;\n\n# \uc774\uac83\ub4e4\uc744 \uadf8\ub300\ub85c \ud654\uba74\uc5d0 \ubd99\uc5ec\ub123\uace0\n$ SSH_AUTH_SOCK=\/tmp\/ssh-GWQEJqNDZHsI\/agent.3260; export SSH_AUTH_SOCK;\nSSH_AGENT_PID=3261; export SSH_AGENT_PID;\necho Agent pid 3261;\nAgent pid 3261\n\n# ssh-add\ub97c \uc2dc\ub3c4\ud55c\ub2e4.\n$ ssh-add ~\/.ssh\/my_private_key \nIdentity added: \/home\/litcoder\/.ssh\/my_private_key (\/home\/litcoder\/.ssh\/my_private_key)<\/pre>\n\n\n\n<p>\uadf8\ub7f0\ub370 \ubcf5\ubd99\ud558\ub294 \uac74 \ub108\ubb34 \ubc88\uac70\ub85c\uc6b0\ub2c8\uae4c eval command\ub97c \uc0ac\uc6a9\ud574\uc11c ssh-agent\uc758 \uacb0\uacfc\ubb3c\uc744 \uadf8\ub300\ub85c \uc218\ud589\ud558\ub3c4\ub85d \ud558\uba74 \ubcf5\ubd99\ud55c \uac83\uacfc \ub3d9\uc77c\ud55c \ud6a8\uacfc\ub97c \ub0bc \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ eval `ssh-agent`\nAgent pid 4416\n\n$ ssh-add ~\/.ssh\/my_private_key \nIdentity added: \/home\/litcoder\/.ssh\/my_private_key (\/home\/litcoder\/.ssh\/my_private_key)<\/pre>\n\n\n\n<p>\ub9e4\ubc88 \ub85c\uadf8\uc778 \ud560 \ub54c \ub9c8\ub2e4 \ubc18\ubcf5 \ud558\ub294 \uac74 \uadc0\ucc2e\uc73c\ub2c8\uae4c .bashrc \uac19\uc740\uacf3\uc5d0 \ub123\uc5b4\ub450\uc790.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#.bashrc\n...\neval `ssh-agent`\nssh-add ~\/.ssh\/my_private_key<\/pre>\n\n\n\n<p>\ub2e4\uc2dc \ub85c\uadf8\uc778\ud574\uc11c \uc2dc\ud5d8\ud574\ubcf4\uba74 permission error\uac00 \uc5c6\uc774 \uc798 \uc2e4\ud589\ub418\ub294 \uac78 \ubcfc \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ ssh -T git@github.com\nHi litcoder! You've successfully authenticated, but GitHub does not provide shell access.<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc8fc\ub85c \uc2dc\uc2a4\ud15c\uc744 \uc124\uc815\ud558\ub294 \ucd08\uae30\uc5d0 \ubc1c\uc0dd\ud558\ub294 \ubb38\uc81c\uc778\ub370 private key\uac00 \uc81c\ub300\ub85c \uc788\uace0 file permission\ub3c4 \uc798 \uc124\uc815 \ub418\uc5b4 \uc788\uc74c\uc5d0\ub3c4 ssh \uc811\uc18d\uc744 \uc2dc\ub3c4\ud558\uba74 \uad8c\ud55c \uc624\ub958\uac00 \ubc1c\uc0dd\ud558\ub294 \uacbd\uc6b0\uac00 \uc788\ub2e4. \ud574\uacb0\ud558\ub294 \ubc29\ubc95\uc740 \uc0ac\uc6a9\ud558\ub824\ub294 private key\ub97c ssh-add \uba85\ub839\uc5b4\ub97c \uc774\uc6a9\ud574\uc11c ssh-agent\uc5d0\uac8c \ucd94\uac00\ud574 \uc8fc\ub294 \uac83\uc778\ub370, \ub9cc\uc57d ssh-agent\uac00 \ub3d9\uc791\ud558\uc9c0 \uc54a\ub294 \uc0c1\ud0dc\ub77c\uba74 \uc774 \ub3d9\uc791\uc5d0\ub3c4 \uc624\ub958\uac00 \ubc1c\uc0dd\ud55c\ub2e4. \uc774\uc640 \uac19\uc740 \uc778\uc99d agent \uad00\ub828\ud55c \ubb38\uc81c\uac00 \uc0dd\uae38 \ub54c\ub294 ssh-agent\ub97c \uc2e4\ud589\ud574\uc11c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,6],"tags":[53,70,364,363,117],"class_list":["post-3853","post","type-post","status-publish","format-standard","hentry","category-linux","category-tools","tag-git","tag-key","tag-permission","tag-publickey","tag-ssh"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/posts\/3853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/litcoder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3853"}],"version-history":[{"count":11,"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/posts\/3853\/revisions"}],"predecessor-version":[{"id":3922,"href":"https:\/\/litcoder.com\/index.php?rest_route=\/wp\/v2\/posts\/3853\/revisions\/3922"}],"wp:attachment":[{"href":"https:\/\/litcoder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/litcoder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/litcoder.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}