MANDOS-KEYGEN(8)

πŸ“¦
version 1.8.19 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– MANDOS-KEYGEN(8) β€” bestie edition πŸ’–

okay so. this is mandos-keygen, and it lives in the Mandos Manual, section 8 (that's the "system admin commands" girlies). she's the one who makes your keys. your literal keys to the kingdom. let's get into it πŸ—οΈβœ¨


✨ NAME ✨

mandos-keygen β€” generate key and password for Mandos client and server. yes bestie, keys AND passwords. she does both. multi-talented. πŸ’…


🌸 SYNOPSIS 🌸

mandos-keygen [--dir DIRECTORY | -d DIRECTORY]
              [--type KEYTYPE | -t KEYTYPE]
              [--length BITS | -l BITS]
              [--subtype KEYTYPE | -s KEYTYPE]
              [--sublength BITS | -L BITS]
              [--name NAME | -n NAME]
              [--email ADDRESS | -e ADDRESS]
              [--comment TEXT | -c TEXT]
              [--expire TIME | -x TIME]
              [--tls-keytype KEYTYPE | -T KEYTYPE]
              [--force | -f]

mandos-keygen {--password | -p | --passfile FILE | -F FILE}
              [--dir DIRECTORY | -d DIRECTORY]
              [--name NAME | -n NAME] [--no-ssh | -S]

mandos-keygen {--help | -h}

mandos-keygen {--version | -v}

four whole modes of existing. she contains multitudes. πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

so mandos-keygen is literally the program that generates the TLS and OpenPGP keys that mandos-client(8mandos) uses. that's it, that's the job. πŸ’…

the keys get written to /etc/keys/mandos by default β€” for later installation into the initrd image β€” but bestie, that AND most other things can be changed with command line options. she's flexible like that. 🌈

this program can ALSO be used with the --password or --passfile options to generate a ready-made section for clients.conf (peep mandos-clients.conf(5)). she does it all, no cap πŸ‘‘


πŸŽ€ PURPOSE πŸŽ€

the whole point of this is to enable remote and unattended rebooting of a client host computer with an encrypted root file system. that's the vibe. that's the mission. 🫢

if you want the full lore, go read the section called "OVERVIEW" β€” it's right down there. keep scrolling bestie πŸ“œ


πŸ‘‘ OPTIONS πŸ‘‘

  • --help, -h β€” show a help message and exit. she tells you what she knows and dips. bye! πŸ‘‹
  • --dir DIRECTORY, -d DIRECTORY β€” target directory for key files. default is /etc/keys/mandos.
  • --type TYPE, -t TYPE β€” OpenPGP key type. default is "RSA".
  • --length BITS, -l BITS β€” OpenPGP key length in bits. default is 4096.
  • --subtype KEYTYPE, -s KEYTYPE β€” OpenPGP subkey type. default is "RSA"
  • --sublength BITS, -L BITS β€” OpenPGP subkey length in bits. default is 4096.
  • --email ADDRESS, -e ADDRESS β€” email address of key. default is empty.
  • --comment TEXT, -c TEXT β€” comment field for key. default is empty.
  • --expire TIME, -x TIME β€” key expire time. default is no expiration. see gpg(1) for syntax.
  • --tls-keytype KEYTYPE, -T KEYTYPE β€” TLS key type. default is "ed25519"
  • --force, -f β€” force overwriting old key. she's not asking permission, she's just doing it 😀
  • --password, -p β€” prompt for a password and encrypt it with the key already present in either /etc/keys/mandos or the directory specified with the --dir option. outputs, on standard output, a section suitable for inclusion in mandos-clients.conf(8). the host name or the name specified with the --name option is used for the section header. all other options are ignored, and no key is created. note: white space is stripped from the beginning and from the end of the password; see the section called "BUGS". ⚠️
  • --passfile FILE, -F FILE β€” the same as --password, but read from FILE, not the terminal, and white space is not stripped from the password in any way. much better honestly πŸ’–
  • --no-ssh, -S β€” when --password or --passfile is given, this option will prevent mandos-keygen from calling ssh-keyscan to get an SSH fingerprint for this host and, if successful, output suitable config options to use this fingerprint as a checker option in the output. this is otherwise the default behavior. (yes, she's that girl by default β€” you have to actively tell her to chill) πŸ™ˆ

🌈 OVERVIEW 🌈

this is part of the Mandos system for allowing computers to have encrypted root file systems and at the same time be capable of remote and/or unattended reboots. ✨

the computers run a small client program in the initial RAM disk environment which will communicate with a server over a network. all network communication is encrypted using TLS. the clients are identified by the server using a TLS key; each client has one unique to it. the server sends the clients an encrypted password. the encrypted password is decrypted by the clients using a separate OpenPGP key, and the password is then used to unlock the root file system, whereupon the computers can continue booting normally. πŸŽ€

the way that this program is a small utility to generate new TLS and OpenPGP keys for new Mandos clients, and to generate sections for inclusion in clients.conf on the server. that's her whole personality and honestly? iconic.


πŸ’€ EXIT STATUS πŸ’€

the exit status will be 0 if a new key (or password, if the --password option was used) was successfully created, otherwise not. otherwise not is doing a LOT of heavy lifting there but okay 😭


πŸ¦‹ ENVIRONMENT πŸ¦‹

  • TMPDIR β€” if set, temporary files will be created here. see mktemp(1).

πŸ“ FILES πŸ“

use the --dir option to change where mandos-keygen will write the key files. the default file names are shown here. πŸ“

  • /etc/keys/mandos/seckey.txt β€” OpenPGP secret key file which will be created or overwritten.
  • /etc/keys/mandos/pubkey.txt β€” OpenPGP public key file which will be created or overwritten.
  • /etc/keys/mandos/tls-privkey.pem β€” private key file which will be created or overwritten.
  • /etc/keys/mandos/tls-pubkey.pem β€” public key file which will be created or overwritten.
  • /tmp β€” temporary files will be written here if TMPDIR is not set.

notice how she says "created or overwritten" like four times. she is NOT subtle and she is NOT sorry. πŸ’…


😭 BUGS 😭

the --password/-p option strips white space from the start and from the end of the password before using it. if this is a problem, use the --passfile option instead, which does not do this. bestie this is literally the whole reason --passfile exists. respect the workaround 🫢

please report bugs to the Mandos development mailing list: <mandos-dev@recompile.se> (subscription required). note that this list is public. πŸ‘€

the developers can be reached privately at <mandos@recompile.se> (OpenPGP key fingerprint 153A 37F1 0BBA 0435 987F 2C4A 7223 2973 CA34 C2C4 for encrypted mail). πŸ”


🧚 EXAMPLE 🧚

normal invocation needs no options. she just ✨ goes ✨:

mandos-keygen

create key in another directory and of another type. force overwriting old key files:

mandos-keygen --dir ~/keydir --type RSA --force

prompt for a password, encrypt it with the keys in /etc/keys/mandos and output a section suitable for clients.conf.

mandos-keygen --password

prompt for a password, encrypt it with the keys in the client-key directory and output a section suitable for clients.conf.

mandos-keygen --password --dir client-key

see how the last two are basically the same but with ONE extra flag?? that's range. that's versatility. that's her. πŸ‘‘


πŸ”₯ SECURITY πŸ”₯

the --type, --length, --subtype, and --sublength options can be used to create keys of low security. if in doubt, leave them to the default values. do NOT be cute with these, i'm begging you πŸ™

the key expire time is not guaranteed to be honored by mandos(8). so like. set it if you want but don't build your whole personality around it. πŸ’€


🌟 SEE ALSO 🌟

the girlies she hangs out with 🫢 go read them, iykyk


Copyright Β© 2008-2019 Teddy Hogeborn, BjΓΆrn PΓ₯hlsson

this manual page is part of Mandos.

Mandos 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 3 of the License, or (at your option) any later version.

Mandos 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 for more details.

you should have received a copy of the GNU General Public License along with Mandos. if not, see http://www.gnu.org/licenses/. πŸ“œ


and that's the whole page bestie!! this is Mandos version 1.8.19, dated 2019-07-18, and it lives at MANDOS-KEYGEN(8) in the Mandos Manual. go make some keys, stay encrypted, and remember: whitespace gets stripped on --password so use --passfile if you're fancy πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from