For When You Can't Have The Real Thing
[ start | index | login ]
start > Linux > OpenSSH > Identifying SSH Key Fingerprints

Identifying SSH Key Fingerprints

Created by dave. Last edited by dave, 123 days ago. Viewed 124 times. #1
[edit] [rdf]
labels
attachments
(2018-08-17)

Problem

When ssh logs pubkey use at login time, it only logs the key fingerprint. We need to figure out which key was used to log in because presumably from that we can figure out who did the login.

Solution

Shell code:

(
  p="$(mktemp)"
  cat ~/.ssh/authorized_keys | while IFS="$(printf "\n")" read key; do 
    echo $key > $p
    echo `ssh-keygen -lf $p` `awk '{print $3}' < $p` | awk '{print $2, $5}'
  done
  rm -f $p
)

(Based on a comment in one of the answers in >>source)

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt