98,853
社区成员
发帖
与我相关
我的任务
分享
Script to list all the finger prints from the authorized_keys
file, created by saravana:
#!/usr/bin/ksh
USER=`whoami`
USER_H=` lsuser -a home $USER |awk -F '=' '{print $2}'`
cat $USER_H/.ssh/authorized_keys| while read line
do
echo $line > /tmp/finger_print
echo "************* Key,finger print details below ***************************"
cat /tmp/finger_print
echo
ssh-keygen -l -f /tmp/finger_print|grep -v not|awk '{print $1" " $2 " " $4}'
if ssh-keygen -l -f /tmp/finger_print|grep "is not a" > /dev/null 2>&1
then
echo "The above key is an Invalid Key,Please correct it"
fi
echo "========================================================================"
rm /tmp/finger_print