{"id":3775,"date":"2025-07-05T22:06:38","date_gmt":"2025-07-05T21:06:38","guid":{"rendered":"https:\/\/kudzia.eu\/b\/?p=3775"},"modified":"2025-07-06T21:24:30","modified_gmt":"2025-07-06T20:24:30","slug":"matching-sshds-log-accepted-publickey-for-to-specific-public-key","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2025\/07\/matching-sshds-log-accepted-publickey-for-to-specific-public-key\/","title":{"rendered":"matching sshd&#8217;s log &#8216;Accepted publickey for&#8217; to specific public key"},"content":{"rendered":"\n<p><em>journalctl -f <\/em>or <em>tail -f \/var\/log\/auth.log<\/em> shows on successful login something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Jul 05 21:00:42 hostname sshd&#91;3242155]: Accepted publickey for root from 10.9.8.7 port 53250 ssh2: RSA SHA256:GDF.......somehash..................k\n<\/code><\/pre>\n\n\n\n<p>that <em>GDF&#8230;&#8230;.somehash&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;k <\/em>is a fingerprint of publish ssh key and matches one of the entries in <em>authorized_keys<\/em>. which one?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>while read -r line; do\n    ssh-keygen -lf &lt;(echo \"$line\")\ndone &lt; ~\/.ssh\/authorized_keys<\/code><\/pre>\n\n\n\n<p>will show you fingerprints for all of the existing authorized keys, now you can match it with the log trace of successful login.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>journalctl -f or tail -f \/var\/log\/auth.log shows on successful login something like this: that GDF&#8230;&#8230;.somehash&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;k is a fingerprint of publish ssh key and matches one of the entries in authorized_keys. which one? will show you fingerprints for all of the existing authorized keys, now you can match it with the log trace of successful login.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[6,129,130],"class_list":["post-3775","post","type-post","status-publish","format-standard","hentry","category-unimportant","tag-linux","tag-ssh","tag-til"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=3775"}],"version-history":[{"count":1,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3775\/revisions"}],"predecessor-version":[{"id":3776,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3775\/revisions\/3776"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=3775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=3775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=3775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}