IPSEC_SHOWHOSTKEY(8)
π ipsec_showhostkey β like, the whole manual, but make it make sense
Hey bestie, welcome to IPSEC_SHOWHOSTKEY(8) β the ipsec_showhostkey page, rewritten so you actually get it. Sit down, grab a strawberry π, and let's go.
β¨ NAME β¨
ipsec_showhostkey β shows off this host's authentication key. That's it. That's the vibe. π
π SYNOPSIS π
ipsec showhostkey [--verbose]
{--version | --list | --dump | --left | --right | --ipseckey | --pem}
[--ckaid ckaid | --rsaid rsaid]
[--gateway gateway] [--precedence precedence]
[--nssdir nssdir] [--password password]
Bestie, look at those curly braces. { } means pick exactly one, no cap. Pick two and it's not gonna be cute for you. π
πΈ DESCRIPTION πΈ
showhostkey prints β on standard output, where all the good stuff goes β a public key that's suitable for this host, in whatever format you specified. Where does it get it? From the host key info chillin' in the NSS database. ποΈβ¨
Okay so real talk: generally, since only the super-user can even access the NSS database, only the super-user can display the public key information. That's just how it is, bestie. Not my rules. π
π Common Options (the everyday girlies)
--versionβ prints the libreswan version and then dips out. Bye! π--verboseβ turns up the verbosity. More words, more info, more main character energy.--nssdir nssdirβ tells it which libreswan directory holds the NSS database. The default is/var/lib/ipsec/nss.--password passwordβ the password used when accessing the NSS database. The default is contained in/etc/ipsec.d/nsspassword.
π¦ List Options (just showing you what's there)
--listβ lists the private keys.--dumpβ lists the private keys with more details. She's thorough. π
π Public Key Options (the actual key reveal)
--ckaid ckaidβ selects which public key to display, using the NSS ckaid.--rsaid rsaidβ selects which public key to display, using the RSA key ID.--pemβ prints the selected public key in PEM encoded ASN.1 format. Fancy. π--left,--rightβ prints the selected public key inipsec.conf(5)format, as aleftrsasigkeyorrightrsasigkeyparameter respectively. So--leftmight give you this (key data trimmed down for clarity, obviously):
leftrsasigkey=0sAQOF8tZ2...+buFuFn/
--ipseckeyβ prints the selected public key in a format suitable for use as opportunistic-encryption DNS IPSECKEY record format (RFC 4025). You can specify a gateway with the--gatewayoption, which currently supports IPv4 and IPv6 addresses. For the host name, the value returned bygethostnameis used, with a.appended. Literally just a dot tacked on the end. That's the rule. β¨
For example, --ipseckey --gateway 10.11.12.13 might give you this (key data trimmed for clarity):
IN IPSECKEY 10 1 2 10.11.12.13 AQOF8tZ2...+buFuFn/"
--gateway gatewayβ for--ipseckey, this specifies the gateway to display with the DNS IPSECKEY record.--precedence precedenceβ for--ipseckey, this specifies the precedence to display with the DNS IPSECKEY record.
π DIAGNOSTICS π
If it complains about βno pubkey line foundβ β don't panic, here's the tea: it means the host has a key, but that key was generated with an old version of FreeS/WAN, and it doesn't contain the information that showhostkey needs. Old key, new tool, awkward silence. π«
ποΈ FILES ποΈ
/var/lib/ipsec/nss/etc/ipsec.d/nsspassword
π SEE ALSO π
ipsec.conf(5), ipsec rsasigkey(8), ipsec newhostkey(8)
Go read those too, iykyk. π
π§ HISTORY π§
Written for the Linux FreeS/WAN project <https://www.freeswan.org> by Henry Spencer. Updated by Paul Wouters for the IPSECKEY format. Character development, honestly. π±
π BUGS π
Arguably, rather than 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, to generate a suitable output line. Likeβ¦ it could just fix it for you. It does not. Arguably. π
π₯ AUTHOR π₯
Paul Wouters
- placeholder to suppress warning
(That's literally what it says. A placeholder. To suppress a warning. Iconic behaviour, no notes. π)
β That's the whole page, bestie β from libreswan, dated 10/19/2026, the IPSEC_SHOWHOSTKEY(8) manual. Now go print a key and slay the day. ππ¦β¨
π¦ where this page comes from
- centos-stream 9: libreswan 4.15-11.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms