kb:sshfp.sh
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| kb:sshfp.sh [2012/06/24 21:25] – pasky | kb:sshfp.sh [2014/09/17 09:39] (current) – aix platform support ruza | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== SSHFP (fingerprint) DNS record generator ===== | ||
| + | <code bash sshfp.sh> | ||
| + | #!/bin/bash | ||
| + | # ruza < | ||
| + | # May 2012 | ||
| + | # generates sshfp for Bind | ||
| + | |||
| + | PLATFORM=" | ||
| + | |||
| + | case ${PLATFORM} in | ||
| + | AIX) | ||
| + | FQDN=" | ||
| + | DOMAIN=" | ||
| + | FQDN=" | ||
| + | ;; | ||
| + | Linux) | ||
| + | FQDN=" | ||
| + | ;; | ||
| + | esac | ||
| + | |||
| + | # https:// | ||
| + | # https:// | ||
| + | |||
| + | cipher[1]=' | ||
| + | cipher[2]=' | ||
| + | cipher[3]=' | ||
| + | |||
| + | hashalg[1]=' | ||
| + | hashalg[2]=' | ||
| + | |||
| + | cd /etc/ssh/ | ||
| + | |||
| + | for (( i_hash = 1 ; i_hash <= ${# | ||
| + | for (( i_ciph = 1 ; i_ciph <= ${# | ||
| + | |||
| + | # no sshd host key of this type, skip it | ||
| + | test -f ssh_host_${cipher[$i_ciph]}_key.pub || continue | ||
| + | |||
| + | # dns comment line | ||
| + | echo "; ${cipher[$i_ciph]} key hashed by ${hashalg[$i_hash]}" | ||
| + | # generates hash | ||
| + | HASH=" | ||
| + | # sshfp line format | ||
| + | echo " | ||
| + | done | ||
| + | done | ||
| + | |||
| + | cd - 1>/ | ||
| + | </ | ||
kb/sshfp.sh.txt · Last modified: 2014/09/17 09:39 by ruza