{"id":4096,"date":"2019-04-04T16:25:55","date_gmt":"2019-04-04T10:55:55","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=4096"},"modified":"2019-04-11T11:27:50","modified_gmt":"2019-04-11T05:57:50","slug":"permission-denied-publickey","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/permission-denied-publickey\/","title":{"rendered":"Git Error: Permission denied (publickey)"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Git Error: Permission denied (publickey)<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Date posted: 04\/04\/2019<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Usually this kind of error will occur for different kind of issues. One of the cause is if remote machine doesn&#8217;t match with local machine&#8217;s public key or doesn&#8217;t have public key. It is solvable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you generate key without root, better use <strong>sudo<\/strong>. Because you will not use the same key for command with sudo.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check the connection<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Connect the remote GitHub server using ssh command.You will get response like below.You can use <strong>-v<\/strong> option with your ssh command to see the details.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-02-09-1024x555.png\" alt=\"\" class=\"wp-image-4106\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-02-09-1024x555.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-02-09-300x163.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-02-09-768x416.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-02-09.png 1235w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"997\" height=\"153\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-24-54.png\" alt=\"\" class=\"wp-image-4127\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-24-54.png 997w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-24-54-300x46.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-24-54-768x118.png 768w\" sizes=\"(max-width: 997px) 100vw, 997px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This means, on your local machine, you haven&#8217;t made any SSH keys. Not to worry.Go to ~\/.ssh\/id_rsa.pub.Copy the key then do the following process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1.Login to your GitHub account online.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2.Go to <strong>Settings.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img decoding=\"async\" width=\"223\" height=\"344\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-16-13.png\" alt=\"\" data-id=\"4124\" data-link=\"https:\/\/pheonixsolutions.com\/blog\/?attachment_id=4124\" class=\"wp-image-4124\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-16-13.png 223w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-16-13-194x300.png 194w\" sizes=\"(max-width: 223px) 100vw, 223px\" \/><\/figure><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">3.Select SSH and GPG keys.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here we have to save the public key that you have your local machine&#8217;s ~\/.ssh\/id_rsa.pub.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"562\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-05-50-1024x562.png\" alt=\"\" class=\"wp-image-4115\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-05-50-1024x562.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-05-50-300x165.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-05-50-768x421.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-03-19-05-50.png 1176w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click on <strong> New SSH key.<\/strong>paste the public key from your local machine without any extra space or a character.Then save the key with your preferred title.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now try ssh connection from command line.It will work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong>If you don&#8217;t have ssh public key you have to generate a new key using <strong>ssh-keygen <\/strong>command.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"505\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-20-25.png\" alt=\"\" class=\"wp-image-4125\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-20-25.png 808w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-20-25-300x188.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-20-25-768x480.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-04-14-20-25-400x250.png 400w\" sizes=\"(max-width: 808px) 100vw, 808px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for using pheonixsolutions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You find this tutorial helpful? Share with your friends to keep it alive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git Error: Permission denied (publickey) Date posted: 04\/04\/2019 Introduction Usually this kind of error will occur for different kind of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1021],"tags":[598,334],"class_list":["post-4096","post","type-post","status-publish","format-standard","hentry","category-mobile-flutter","tag-github","tag-ssh-key","psol-cat-mobile-flutter"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-144","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4096"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4096\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}