IPSEC_NEWHOSTKEY(8)
π IPSEC_NEWHOSTKEY(8) π
ok so bestie, welcome to the ipsec_newhostkey page β it lives in the Executable programs manual, and it's genuinely one of the most useful little gremlins in the libreswan toolbox. pull up a chair π
β¨ NAME β¨
ipsec_newhostkey β generate a new raw RSA authentication key for a host πΈ
π SYNOPSIS π
ipsec newhostkey [[--quiet] | [--verbose]] [--nssdirnssdir]
[--password password] [--bits bits] [--curve curve]
[--keytype rsa|ecdsa] [--seeddev device]
π¦ DESCRIPTION π¦
okay so here's the vibe: newhostkey generates an RSA public/private key pair that's suitable for authenticating this host, and then it stores that key pair in the NSS database. that's it, that's the whole job, and it does it beautifully π
and if you're sitting there like "cool but how do i actually get the public key back out?" β breathe, bestie, that's literally what ipsec_showhostkey(8) is for. go see her. she's iconic for that.
πΈ Output Options πΈ
--quietβ the--quietoption suppresses both thersasigkeynarrative and the existing-file warning message. so it just shuts up and works. no cap π€«--nssdir nssdirβ this one tells it where the NSS DB directory lives, i.e. the place where the certificate, key, and modsec databases reside. the default is/var/lib/ipsec/nssποΈ--password passwordβ specifies a module authentication password, which you might need if FIPS mode is enabled. think of it as the secret handshake β¨--bits bitsβ sets how many bits go in the RSA key. the current default is a random value that's a multiple of 16, somewhere between3072and4096. the minimum allowed is2192β go below that and it's not it, bestie π--curve curveβ specifies the named curve used in the ECDSA key. current default issecp256r1. for the full list of available curve names, go checkipsec_ecdsasigkey(8)π--keytype rsa|ecdsaβ picks the type of key: eitherrsa(RSA) orecdsa(ECDSA). if you omit it entirely, the current default isrsaπ--seeddev deviceβ used to specify the random device (default/dev/random) used to seed the crypto library RNG. main character energy for entropy purposes π
β FILES β
/dev/random, /dev/urandom β the randomness girlies π
π₯ SEE ALSO π₯
ipsec_rsasigkey(8), ipsec_showhostkey(8), ipsec.secrets(5) β go read these too, iykyk π
π HISTORY π
originally written for the Linux FreeS/WAN project <https://www.freeswan.org> by Henry Spencer. later updated by Paul Wouters. a whole lineage, honestly π«Ά
π BUGS π
ok so real talk, this is the part where you do not get to be impatient. as with rsasigkey, the run time is difficult to predict β because depletion of the system's randomness pool can cause arbitrarily long waits for random bits for seeding the NSS library, and the prime-number searches can also take unpredictable (and potentially large) amounts of CPU time. so likeβ¦ go make a snack, bestie. it'll be done when it's done π
see ipsec_rsasigkey(8) for more on that.
fr fr do not assume this returns fast. it is not giving speedrun energy.
π«Ά AUTHOR π«Ά
Paul Wouters
- placeholder to suppress warning π
and that's the whole page, bestie! this one's from libreswan, dated 10/19/2026 β slay, go generate some keys, and remember: --quiet if you can't handle the narration πβ¨
π¦ 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