#!/bin/bash DIR="." while read LINE do key1=$(echo $LINE | /usr/bin/ssh-keygen -lf -) key2=$1 if [[ $key1 =~ $key2 ]] then echo $key1 fi done< ~/.ssh/authorized_keys