SSHFP(1)
π¦ SSHFP(1) β the sshfp girlies' guide π¦
okay bestie, welcome to sshfp(1) from the Internet / DNS section of the manual. she generates SSHFP DNS records and she EATS. let's go π
β¨ NAME β¨
sshfp β generate SSHFP DNS records from knownhosts files or ssh-keyscan πΈ
β¨ SYNTAX β¨
sshfp [-k <knownhosts_file>] [-d] [-a] [-t <algo>] [--digest <digest>]
[<host1> [<host2> ...]]
sshfp -s [-p <port>] [-d] [-a] [-t <algo>] [--digest <digest>] [-n
<nameserver>] <domain1> [domain2] <host1> [host2 ...]
two whole modes, two whole vibes, pick your fighter π
β¨ DESCRIPTION β¨
so basically, sshfp generates RFC-4255 SSHFP DNS records. and it gets those records from one of two places:
- the public keys chillin' in a
known_hostsfile β which lowkey means the user already trusted that key at some point π - public keys grabbed by using
ssh-keyscan(1)π¦
real talk though: using ssh-keyscan(1) implies a secure path to connect to the hosts you're scanning. it also implies trust in the DNS to get the IP address of the hostname you're scanning. that's two whole trust assumptions, bestie, not one.
and if the nameserver of the domain allows zone transfers (AXFR)? then an entire domain can be processed for all its A records. the whole thing. slay. β¨
β¨ OPTIONS β¨
-s,--scan<hostname1> [hostname2 ...] β scan a host or a whole domain for public SSH keys usingssh-keyscan. go get 'em π₯-k,--knownhosts<knownhosts_file> <hostname1> [hostname2 ...] β grab public SSH keys out of aknown_hostsfile. defaults to using~/.ssh/known_hostsπ-a,--allβ when you use it with-k, it scans all the hosts in theknown_hostsfile. when you use it with-s, it will attempt a zone transfer (AXFR) to obtain all A records in the domain you specified. all of them. the entire buffet π-d,--trailing-dotβ adds a trailing dot to the hostname in the SSHFP records. and here's the whole tea, bestie, because it's genuinely a lot: it is not possible to determine whether a known_hosts or DNS query is for a FQDN (egwww.redhat.com) or not (egwww) or not (unless-d domainname -ais used, in which case a trailing dot is always appended). non-FQDN get their domainname appended through/etc/resolv.conf. these non-FQDN will happen when using a non-FQDN (egsshfp -k www) or known_hosts entries obtained by runningssh www.subwhere.domain.comis implied. when-dis used, all hostnames not ending with a dot, that at least contain two parts in their hostname (egwww.subbut notwww) get a trailing dot. and note that the output ofsshfpcan also just be manually edited for trailing dots. DIY icon behaviour π--digest<digest> β fingerprint hash function. may be specified more than once. defaultsha1,sha256π-n,--nameserver<nameserver> β nameserver to use for AXFR (only valid with-s -a) β-o,--output<filename> β write to filename instead of stdout π-p,--port<portnumber> β use portnumber for scanning. and note that portnumbers do NOT appear in SSHFP records π-h,--helpβ output help information and exit π-T,--timeout<seconds> β scanning timeout, in seconds (default5) β±οΈ-t,--type<algo> β key type to fetch. may be specified more than once. defaultrsa,ecdsa,ed25519,dsa,xmssπ-v,--versionβ output version information and exit π-q,--quietβ output less miscellany tostderr. shhh π€«
β¨ FILES β¨
~/.ssh/known_hosts
that's the one. the sacred text π
β¨ REQUIREMENTS β¨
sshfp requires python-dns (http://www.pythondns.org) β no cap, you need it π§
- Fedora:
yum install python-dns - Debian:
apt-get install python-dnspython
β¨ BUGS β¨
bestie. listen. π
- if a domain contains non-working glue A records, then
ssh-keyscanaborts instead of skipping the single broken entry. one bad apple and the whole thing quits. rude. - this program can look up hashed hostnames in a
known_hostsfile β but only if a recent-enoughssh-keygenis present π
β¨ EXAMPLES β¨
typical usage:
sshfp(implies-k -a)sshfp -a -d(implies-k)sshfp -k bofh.nohats.ca(fromknown_hosts)sshfp -s bofh.nohats.ca(from a scan to the host)sshfp -k ~paul/.ssh/known_hosts bofh.nohats.ca www.openswan.org -o /tmp/mysshfp.txtsshfp -a -d -d nohats.ca -n ns0.nohats.ca >> /var/named/primary/nohats.ca
look at her go ππ₯
β¨ SEE ALSO β¨
ssh-keyscan(1) ssh(1) tlsa(1) and RFC-4255 π«Ά
β¨ AUTHORS β¨
- Paul Wouters <pwouters@redhat.com>
- Jacob Appelbaum <jacob@appelbaum.net>
- James Brown <jbrown@yelp.com>
the founding mothers, respectfully π
β¨ COPYRIGHT β¨
Copyright 2006-2010 Xelerance Corporation
Copyright 2012 Paul Wouters
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License (file COPYING in the distribution) for more details.
okay that's the whole page, you're literally a DNS icon now π
and that's a wrap, bestie β this one's brought to you by Paul Wouters, January 2, 2015, and the SSHFP(1) manual page. go forth and generate those records πβ¨π
π¦ where this page comes from
- epel 10: hash-slinger 3.6-2.el10_3 Β· GPL-2.0-or-later
- epel 9: hash-slinger 3.6-2.el9 Β· GPL-2.0-or-later
- fedora 43: hash-slinger 3.6-2.fc43 Β· GPL-2.0-or-later
- fedora 44: hash-slinger 3.5-1.fc44 Β· GPL-2.0-or-later
- fedora 44: hash-slinger 3.6-2.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms