| | 1 | Yoou can use this script to print the ssh private key fingerprints for a server: |
| | 2 | |
| | 3 | {{{ |
| | 4 | #!/usr/bin/env bash |
| | 5 | |
| | 6 | # check the ssh fingerpints for the server keys |
| | 7 | # http://www.phcomp.co.uk/Tutorials/Unix-And-Linux/ssh-check-server-fingerprint.html |
| | 8 | |
| | 9 | # check that the script is being run by root |
| | 10 | if [[ "$(id -u)" != "0" ]] ; then |
| | 11 | echo "You must run '$0' as root or via sudo" |
| | 12 | exit 1 |
| | 13 | fi |
| | 14 | |
| | 15 | for file in /etc/ssh/*_key.pub ; do |
| | 16 | ssh-keygen -lf $file |
| | 17 | done |
| | 18 | }}} |
| | 19 | |
| | 20 | This script is installed on [[Crin1]], [[Crin2]], [[Crin3]] and [[Crin4]] at `/usr/local/bin/ssh-private-key-fingerprints` |