IPSEC-SHOWHOSTKEY(8)
π IPSEC-SHOWHOSTKEY(8) π
okay bestie, gather round, because this little cutie lives in section 8 of your manual (executable programs, yk the "the grown-ups run this" zone) and it's literally just here to show you your host's authentication key. her whole name is ipsec-showhostkey β colloquially showhostkey. she's giving backstage-pass energy.
β¨ NAME β¨
ipsec-showhostkey β show host's authentication key π
π SYNOPSIS π
ipsec showhostkey [--verbose] [--nssdir directory] [--nsspw password]
[--seeddev device] [--seedbits bits]
{--version | --list | --dump | --left | --right | --ipseckey | --pem}
[--ckaid ckaid | --rsaid rsaid]
[--gateway gateway] [--precedence precedence]
πΈ DESCRIPTION πΈ
so basically π
showhostkey prints out β on standard output, she's not shy β a public key that's suitable for this host, in the format you asked for, using the host key info that's chillin' in the NSS database.
and ngl, there's a gatekeeping thing here: since only the super-user can even get into the NSS database, in general only the super-user gets to display the public key info. main character privileges only. π₯
π Common Options
--versionβ print the libreswan version and then dip. that's it, that's the whole job. β¨--verboseβ turn the verbosity up. more talking. π¬--nssdirnssdir β pick which libreswan directory holds the NSS database. the default is/var/lib/ipsec/nss. π--passwordpassword β say which password to use when you go knocking on the NSS database. the default one lives in/etc/ipsec.d/nsspassword. π
π¦ List Options
--listβ list the private keys. just the keys, no drama. ποΈ--dumpβ same list energy but with more details. she's an over-sharer and we love her. π
π Public Key Options
--ckaidckaid β pick which public key to display by using the NSS ckaid. π―--rsaidrsaid β pick which public key to display by using the RSA key ID. π―--pemβ print that selected public key in PEM encoded ASN.1 format. fancy little certificate-girl vibe. π--left,--rightβ print the selected public key inipsec.conf(5)format, as aleftrsasigkeyorrightrsasigkeyparameter respectively. like, for example,--leftmight give you this (key data trimmed down so you can actually read it):
leftrsasigkey=0sAQOF8tZ2...+buFuFn/
--ipseckeyβ print the selected public key in a format that works as the opportunistic-encryption DNS IPSECKEY record format (RFC 4025). you can specify a gateway with--gateway, which rn supports IPv4 and IPv6 addresses. as for the host name, whatevergethostnamehands back is what gets used, with a.appended. ok so for example,--ipseckey --gateway 10.11.12.13might give you this (key data trimmed for clarity):
IN IPSECKEY 10 1 2 10.11.12.13 AQOF8tZ2...+buFuFn/"
--gatewaygateway β for--ipseckey, say which gateway to display alongside the DNS IPSECKEY record. πͺ--precedenceprecedence β for--ipseckey, say which precedence to display alongside the DNS IPSECKEY record. π
π DIAGNOSTICS π
if you ever see a complaint about βno pubkey line foundβ, that means your host does have a key, but it was generated with an old version of FreeS/WAN and it doesn't have the info that showhostkey needs. vintage, but not in the cute way. π
π FILES π
/var/lib/ipsec/nss, /etc/ipsec.d/nsspassword
π«Ά SEE ALSO π«Ά
ipsec.conf(5), ipsec-rsasigkey(8), ipsec-newhostkey(8)
π HISTORY π
written for the Linux FreeS/WAN project <https://www.freeswan.org> by Henry Spencer. then Paul Wouters updated it for the IPSECKEY format. glow-up, honestly. β¨
π BUGS π
arguably β and bestie they said arguably, this is their words not mine β instead of just reporting the no-IN-KEY-line-found problem, showhostkey should be smart enough to run the existing key through rsasigkey with the --oldkey option, so it could generate a suitable output line. like c'mon girl, do the work. π
π AUTHOR π
Andrew Cagney, Daniel Kahn Gillmor, D. Hugh Redelmeier, Jose Quaresma, Michael Richardson, Paul Wouters, Tuomo Soini
okay that's the whole page, we ate and left no crumbs ππ
this was Libreswan 5.4.1, dated 10/23/2026, and it's literally the IPSEC-SHOWHOSTKEY(8) page so you know exactly where to find her again. periodt. πβ
π¦ where this page comes from
- fedora 43: libreswan 5.4.1-1.fc43 Β· GPL-2.0-or-later AND MPL-2.0
- fedora 44: libreswan 5.4.1-1.fc44 Β· GPL-2.0-or-later AND MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms