{"id":697,"date":"2020-07-27T16:29:55","date_gmt":"2020-07-27T20:29:55","guid":{"rendered":"https:\/\/dc540.org\/xxx\/?p=697"},"modified":"2020-07-27T16:29:56","modified_gmt":"2020-07-27T20:29:56","slug":"managing-changed-ssh-keys-in-centos-8","status":"publish","type":"post","link":"https:\/\/dc540.org\/xxx\/2020\/07\/managing-changed-ssh-keys-in-centos-8\/","title":{"rendered":"Managing changed SSH keys in CentOS 8"},"content":{"rendered":"\n<p>All these years, I&#8217;ve dealt with changed SSH keys (you know, you go to SSH into something and you get the &#8220;key has changed&#8221; error:<\/p>\n\n\n\n<p>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br>@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ <br>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br>IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!<br>Someone could be eavesdropping on you right now (man-in-the-middle attack)!<br>It is also possible that a host key has just been changed.<\/p>\n\n\n\n<p>probably because you rebuilt the target server\/vm, or you changed an IP somewhere, or whatever) by removing the entry from ~\/.ssh\/known_hosts.  It&#8217;s a few annoying extra steps, but it has always worked for me. Call it &#8220;old reliable.&#8221;<\/p>\n\n\n\n<p>With the release of CentOS 8, everything changes. Known hosts are now managed by sss.  Maybe this happened somewhere else and I wasn&#8217;t aware of it, but this is how I was made aware of it:<br><br>Message as above, along with:<br>Offending ED25519 key in \/var\/lib\/sss\/pubconf\/known_hosts:6<br><br>Well that&#8217;s new.  And you can&#8217;t delete from that file, because it&#8217;s generated behind the scenes and then comes right back. Generated from ~\/.ssh\/known_hosts, apparently.  And nobody wants to enter a new key manually as it suggests.  The answer?<\/p>\n\n\n\n<p>ssh-keyscan -t ecdsa 10.120.x.x >> ~\/.ssh\/known_hosts<\/p>\n\n\n\n<p>(substituting your target IP, of course).  Almost worth aliasing &#8220;whoopsienewkey&#8221; to it with a variable for the IP.  <\/p>\n\n\n\n<p>Anyhow, that&#8217;s all, I hope you&#8217;ve learned something today to make your day easier and brighter.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>All these years, I&#8217;ve dealt with changed SSH keys (you know, you go to SSH into something and you get the &#8220;key has changed&#8221; error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ WARNING: REMOTE HOST IDENTIFICATION &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/dc540.org\/xxx\/2020\/07\/managing-changed-ssh-keys-in-centos-8\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Managing changed SSH keys in CentOS 8&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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}},"categories":[70],"tags":[],"class_list":["post-697","post","type-post","status-publish","format-standard","hentry","category-command-fu"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/comments?post=697"}],"version-history":[{"count":1,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/697\/revisions"}],"predecessor-version":[{"id":698,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/posts\/697\/revisions\/698"}],"wp:attachment":[{"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/media?parent=697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/categories?post=697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dc540.org\/xxx\/wp-json\/wp\/v2\/tags?post=697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}