MANDOS-CLIENT(8mandos)

๐Ÿ“ฆ
version 1.8.19 ยท 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– MANDOS-CLIENT ๐Ÿ’– โ€” the mandos-client(8mandos) page, but make it make sense

okay bestie, sit down, hydrate, because this is the Mandos Manual page for mandos-client and it's a whole vibe. it's long so we're doing this in parts, and this is part one. let's get into it ๐Ÿฆ‹


โœจ NAME โœจ

mandos-client โ€” the Client for Mandos. that's it, that's the name, she's iconic ๐Ÿ’…


โœจ SYNOPSIS โœจ

here's how you'd call her, in all her glory:

mandos-client [--connect ADDRESS:PORT | -c ADDRESS:PORT]
              [--interface NAME[,NAME...] | -i NAME[,NAME...]...]
              [--pubkey FILE | -p FILE]
              [--seckey FILE | -s FILE]
              [--tls-privkey FILE | -t FILE]
              [--tls-pubkey FILE | -T FILE]
              [--priority STRING]
              [--dh-bits BITS]
              [--dh-params FILE]
              [--delay SECONDS]
              [--retry SECONDS]
              [--network-hook-dir DIR]
              [--debug]

mandos-client {--help | -?}

mandos-client --usage

mandos-client {--version | -V}

โœจ DESCRIPTION โœจ

so mandos-client is a client program, and its whole job is talking to mandos(8) to get a password. lowkey that's the entire plot. but let's go slightly more in detail, because you deserve the tea โ˜•

this client program:

  • brings up network interfaces
  • uses the interfaces' IPv6 link-local addresses to get network connectivity
  • uses Zeroconf to find servers on the local network
  • communicates with servers using TLS with a raw public key to keep things authentic and confidential ๐Ÿ”

and then she just... keeps going. she keeps running, trying all the servers on the network, until she gets a satisfactory reply or eats a TERM signal. after all the servers have been tried, they all get periodically retried. and if there are no servers found? she waits. indefinitely. for new servers to appear. main character patience fr fr ๐Ÿ˜Œ

๐ŸŽ€ how the interfaces get picked

the network interfaces are selected like this: if any interfaces are specified with the --interface option, those interfaces get used. otherwise, mandos-client will use all interfaces that:

  • are not loopback interfaces
  • are not point-to-point interfaces
  • are capable of broadcasting
  • do not have the NOARP flag (peep netdevice(7))

(if the --connect option is used, point-to-point interfaces and non-broadcast interfaces are accepted, so that's the exception, iykyk)

if any of the used interfaces are not up and running, they get taken up first โ€” and later taken down again on program exit. tidy queen ๐Ÿงนโœจ

before network interfaces are selected, all "network hooks" are run; go look at the section called "NETWORK HOOKS".

important: this program is not meant to be run directly. it's really meant to be run by other programs in the initial RAM disk environment. see the section called "OVERVIEW".

โœจ PURPOSE โœจ

the purpose of all this? enabling remote and unattended rebooting of a client host computer that has an encrypted root file system. that's the dream, that's the goal ๐ŸŽฏ see the section called "OVERVIEW" for the details, bestie.


โœจ OPTIONS โœจ

quick note before we dive in: this program is commonly not invoked from the command line. it's normally started by another program, as described in the section called "DESCRIPTION". so any command line options this program accepts are normally handed to it by the invoking program, not typed out by a human. just so you know ๐ŸŒธ

  • --connect=ADDRESS:PORT, -c ADDRESS:PORT โ€” don't use Zeroconf to locate servers. connect directly to only one specified Mandos server. heads up: an IPv6 address has colon characters in it, so the last colon character is assumed to separate the address from the port number. normally Zeroconf would be the move for locating Mandos servers, so this option is basically only used when testing and debugging ๐Ÿงช
  • --interface=NAME[,NAME...], -i NAME[,NAME...] โ€” a comma separated list of network interfaces that will be brought up and scanned for Mandos servers to connect to. the default is the empty string, which automatically uses all appropriate interfaces. if the --connect option is used, and exactly one interface name is specified (except "none"), this specifies the interface to use to connect to the address given. note: since this program will normally run in the initial RAM disk environment, the interface must be an interface which exists at that stage. so the interface can normally not be a pseudo-interface like "br0" or "tun0" โ€” those won't exist until much later in the boot process and can't be used by this program, unless they're created by a "network hook" โ€” see the section called "NETWORK HOOKS". NAME can be the string "none"; that will make mandos-client only bring up interfaces specified before this string. this is not recommended, and is only meant for advanced users ๐Ÿซฃ
  • --pubkey=FILE, -p FILE โ€” OpenPGP public key file name. the default name is /conf/conf.d/mandos/pubkey.txt.
  • --seckey=FILE, -s FILE โ€” OpenPGP secret key file name. the default name is /conf/conf.d/mandos/seckey.txt.
  • --tls-pubkey=FILE, -T FILE โ€” TLS raw public key file name. the default name is /conf/conf.d/mandos/tls-pubkey.pem.
  • --tls-privkey=FILE, -t FILE โ€” TLS secret key file name. the default name is /conf/conf.d/mandos/tls-privkey.pem.
  • --priority=STRING โ€” the GnuTLS priority string for the TLS handshake. the default is
"SECURE128:!CTYPE-X.509:+CTYPE-RAWPK:!RSA:!VERS-ALL:+VERS-TLS1.3
:%PROFILE_ULTRA"

when using raw public keys in TLS, and

"SECURE256
:!CTYPE-X.509:+CTYPE-OPENPGP:!RSA:+SIGN-DSA-SHA256"

when using OpenPGP keys in TLS,. see gnutls_priority_init(3) for the syntax.

warning: changing this may make the TLS handshake fail, making server-client communication impossible. changing this option may also make the network traffic decryptable by an attacker. so like, don't touch it unless you know what you're doing, bestie ๐Ÿ˜ญ
  • --dh-bits=BITS โ€” sets the number of bits to use for the prime number in the TLS Diffie-Hellman key exchange. the default value is selected automatically based on the GnuTLS security profile set in its priority string. note that if the --dh-params option is used, the values from that file will be used instead ๐Ÿ‘‘
  • --dh-params=FILE โ€” specifies a PEM-encoded PKCS#3 file to read the parameters needed by the TLS Diffie-Hellman key exchange from. if this option is not given, or if the file for some reason could not be used, the parameters will be generated on startup, which will take some time and processing power ๐Ÿ˜ฎโ€๐Ÿ’จ those using servers running under time, power or processor constraints may want to generate such a file in advance and use this option. planning ahead? that's growth ๐Ÿ’œ
  • --delay=SECONDS โ€” after bringing a network interface up, the program waits for the interface to arrive in a "running" state before proceeding. during this time, the kernel log level will be lowered to reduce clutter on the system console, alleviating any other plugins which might be using the system console. this option sets the upper limit of seconds to wait. the default is 2.5 seconds.
  • --retry=SECONDS โ€” all Mandos servers are tried repeatedly until a password is received. this value specifies, in seconds, how long between each successive try for the same server. the default is 10 seconds.
  • --network-hook-dir=DIR โ€” network hook directory. the default directory is /lib/mandos/network-hooks.d.
  • --debug โ€” enable debug mode. this will enable a lot of output to standard error about what the program is doing. the program will still perform all other functions normally. it will also enable debug mode in the Avahi and GnuTLS libraries, making them print large amounts of debugging output. so much text. a wall of text. you've been warned ๐Ÿซ 
  • --help, -? โ€” gives a help message about options and their meanings.
  • --usage โ€” gives a short usage message.
  • --version, -V โ€” prints the program version. โœจ

โœจ 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. chef's kiss, honestly ๐Ÿ‘ฉโ€๐Ÿณ๐Ÿ’‹

this program is the client part. it is run automatically in an initial RAM disk environment.

in an initial RAM disk environment using systemd(1), this program is started by the Mandos password-agent(8mandos), which in turn is started automatically by the systemd(1) "Password Agent" system.

in the case of a non-systemd(1) environment, this program is started as a plugin of the Mandos plugin-runner(8mandos), which runs in the initial RAM disk environment because it is specified as a "keyscript" in the crypttab(5) file.

this program could, theoretically, be used as a keyscript in /etc/crypttab, but it would then be impossible to enter a password for the encrypted root disk at the console, since this program does not read from the console at all. so like, theory only, don't do it ๐Ÿ™ˆ


โœจ EXIT STATUS โœจ

this program will exit with a successful (zero) exit status if a server could be found and the password received from it could be successfully decrypted and output on standard output. ๐ŸŽ‰

the program will exit with a non-zero exit status only if a critical error occurs.

otherwise? it will forever connect to any discovered Mandos servers, trying to get a decryptable password and print it. forever forever. girl is committed ๐Ÿ’€๐Ÿ’–


โœจ ENVIRONMENT โœจ

  • MANDOSPLUGINHELPERDIR โ€” this environment variable will be assumed to contain the directory containing any helper executables. the use and nature of these helper executables, if any, is purposely not documented. mysterious. love that for us ๐ŸŽ€

this program does not use any other environment variables, not even the ones provided by cryptsetup(8). nope. none. that's the whole list.

๐Ÿ•ธ๏ธ NETWORK HOOKS ๐Ÿ•ธ๏ธ

Okay so bestie, listen. Sometimes finding a Mandos server needs a network interface that isn't just... there yet. Like a bridge? A tunnel? Those need to be up and running before mandos-client even starts looking for servers, and that's a whole timing situation. โœจ

The fix? You make a โ€œnetwork hookโ€ program and drop it in a special directory. That's it, that's the move.

Before the network is used (and again before program exit), any runnable programs found in the network hook directory get run with the argument โ€œstartโ€ or โ€œstopโ€. Which should bring up or down, respectively, any network interface mandos-client should use. Iconic delegation, honestly. ๐Ÿ’…

โœจ REQUIREMENTS โœจ

A network hook must be an executable file, and its name must consist entirely of upper and lower case letters, digits, underscores, periods, and hyphens. No vibes-based filenames, sorry. ๐ŸŽ€

A network hook will receive one argument, which can be one of the following:

  • start โ€” this should make the network hook create (if necessary) and bring up a network interface. ๐Ÿซถ
  • stop โ€” this should make the network hook take down a network interface, and delete it if it did not exist previously. Bye bestie ๐Ÿ‘‹
  • files โ€” this should make the network hook print, one file per line, all the files needed for it to run. (These files will be copied into the initial RAM filesystem.) Typical use is for a network hook which is a shell script to print its needed binaries.

It is not necessary to print any non-executable files already in the network hook directory โ€” those get copied implicitly if they otherwise satisfy the name requirements. So don't do extra work for no reason, queen. ๐Ÿ’–

  • modules โ€” this should make the network hook print, on separate lines, all the kernel modules needed for it to run. (These modules will be copied into the initial RAM filesystem.) For instance, a tunnel interface needs the โ€œtunโ€ module. ๐ŸŒธ

The network hook will be provided with a number of environment variables:

  • MANDOSNETHOOKDIR โ€” the network hook directory, specified to mandos-client by the --network-hook-dir option. > Note: this should always be used by the network hook to refer to itself or any files in the hook directory it may require. Don't hardcode, babe, it will betray you. ๐Ÿ˜ญ
  • DEVICE โ€” the network interfaces, as specified to mandos-client by the --interface option, combined to one string and separated by commas. If this is set, and does not contain the interface a hook will bring up, there is no reason for a hook to continue. Know when to log off. ๐Ÿ’€
  • MODE โ€” this will be the same as the first argument; i.e. โ€œstartโ€, โ€œstopโ€, โ€œfilesโ€, or โ€œmodulesโ€.
  • VERBOSITY โ€” this will be the โ€œ1โ€ if the --debug option is passed to mandos-client, otherwise โ€œ0โ€.
  • DELAY โ€” this will be the same as the --delay option passed to mandos-client. Is only set if MODE is โ€œstartโ€ or โ€œstopโ€.
  • CONNECT โ€” this will be the same as the --connect option passed to mandos-client. Is only set if --connect is passed and MODE is โ€œstartโ€ or โ€œstopโ€.
A hook may not read from standard input, and should be restrictive in printing to standard output or standard error unless VERBOSITY is โ€œ1โ€. Like, no yapping unless asked, bestie. ๐Ÿ™ˆ

๐Ÿ“ FILES ๐Ÿ“

  • /conf/conf.d/mandos/pubkey.txt, /conf/conf.d/mandos/seckey.txt โ€” OpenPGP public and private key files, in โ€œASCII Armorโ€ format. These are the default file names, they can be changed with the --pubkey and --seckey options. ๐Ÿ”‘
  • /conf/conf.d/mandos/tls-pubkey.pem, /conf/conf.d/mandos/tls-privkey.pem โ€” Public and private raw key files, in โ€œPEMโ€ format. These are the default file names, they can be changed with the --tls-pubkey and --tls-privkey options. ๐Ÿ”
  • /lib/mandos/network-hooks.d โ€” Directory where network hooks are located. Change this with the --network-hook-dir option. See the section called โ€œNETWORK HOOKSโ€. ๐Ÿช

๐Ÿ› BUGS ๐Ÿ›

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 ๐ŸŒˆ

Note that normally, command line options will not be given directly, but passed on via the program responsible for starting this program; see the section called โ€œOVERVIEWโ€. So like, don't come for me if you never type these yourself. ๐Ÿ’…

Normal invocation needs no options, if the network interfaces can be automatically determined:

mandos-client

Search for Mandos servers (and connect to them) using one specific interface:

mandos-client --interface eth1

Run in debug mode, and use custom keys:

mandos-client --debug --pubkey keydir/pubkey.txt --seckey keydir/seckey.txt --tls-pubkey keydir/tls-pubkey.pem --tls-privkey keydir/tls-privkey.pem

Run in debug mode, with custom keys, and do not use Zeroconf to locate a server; connect directly to the IPv6 link-local address โ€œfe80::aede:48ff:fe71:f6f2โ€, port 4711, using interface eth2:

mandos-client --debug --pubkey keydir/pubkey.txt --seckey keydir/seckey.txt --tls-pubkey keydir/tls-pubkey.pem --tls-privkey keydir/tls-privkey.pem --connect fe80::aede:48ff:fe71:f6f2:4711 --interface eth2

๐Ÿ”’ SECURITY ๐Ÿ”’

This program assumes that it is set-uid to root, and will switch back to the original (and presumably non-privileged) user and group after bringing up the network interface. So it borrows the crown, then hands it back. ๐Ÿ‘‘

To use this program for its intended purpose (see the section called โ€œPURPOSEโ€), the password for the root file system will have to be given out to be stored in a server computer, after having been encrypted using an OpenPGP key. This encrypted data which will be stored in a server can only be decrypted by the OpenPGP key, and the data will only be given out to those clients who can prove they actually have that key. This key, however, is stored unencrypted on the client side in its initial RAM disk image file system. This is normally readable by all, but this is normally fixed during installation of this program; file permissions are set so that no-one is able to read that file. ๐Ÿซฃ

The only remaining weak point is that someone with physical access to the client hard drive might turn off the client computer, read the OpenPGP and TLS keys directly from the hard drive, and communicate with the server. To safeguard against this, the server is supposed to notice the client disappearing and stop giving out the encrypted data. Therefore, it is important to set the timeout and checker interval values tightly on the server. See mandos(8).

It will also help if the checker program on the server is configured to request something from the client which can not be spoofed by someone else on the network, like SSH server key fingerprints, and unlike unencrypted ICMP echo (โ€œpingโ€) replies. โœจ

Note: This makes it completely insecure to have Mandos clients which dual-boot to another operating system which is not trusted to keep the initial RAM disk image confidential. ๐Ÿ’€

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

intro(8mandos), cryptsetup(8), crypttab(5), mandos(8), password-agent(8mandos), plugin-runner(8mandos)

  • Zeroconf[1] โ€” Zeroconf is the network protocol standard used for finding Mandos servers on the local network. ๐ŸŒ
  • Avahi[2] โ€” Avahi is the library this program calls to find Zeroconf services. ๐Ÿฆ
  • GnuTLS[3] โ€” GnuTLS is the library this client uses to implement TLS for communicating securely with the server, and at the same time send the public key to the server. ๐Ÿ”
  • GPGME[4] โ€” GPGME is the library used to decrypt the OpenPGP data sent by the server. ๐Ÿ”“

RFC 4291: IP Version 6 Addressing Architecture

  • Section 2.2: Text Representation of Addresses
  • Section 2.5.5.2: IPv4-Mapped IPv6 Address
  • Section 2.5.6, Link-Local IPv6 Unicast Addresses โ€” This client uses IPv6 link-local addresses, which are immediately usable since a link-local addresses is automatically assigned to a network interface when it is brought up. ๐ŸŒˆ

RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2

  • TLS 1.2 is the protocol implemented by GnuTLS.

RFC 4880: OpenPGP Message Format

  • The data received from the server is binary encrypted OpenPGP data.

RFC 7250: Using Raw Public Keys in Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)

  • This is implemented by GnuTLS in version 3.6.6 and is, if present, used by this program so that raw public keys can be used.

RFC 6091: Using OpenPGP Keys for Transport Layer Security

  • This is implemented by GnuTLS before version 3.6.0 and is, if present, used by this program so that OpenPGP keys can be used.

Copyright ยฉ 2008-2024 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. (No warranty bestie, read the fine print. ๐Ÿ˜ญ)

You should have received a copy of the GNU General Public License along with Mandos. If not, see http://www.gnu.org/licenses/.


๐Ÿ“ NOTES ๐Ÿ“

  1. Zeroconf โ€” http://www.zeroconf.org/
  2. Avahi โ€” https://www.avahi.org/
  3. GnuTLS โ€” https://www.gnutls.org/
  4. GPGME โ€” https://www.gnupg.org/related_software/gpgme/

And that's a wrap on the whole page, bestie!! ๐Ÿ’œ This one came from Mandos 1.8.19, dated 2025-06-27, and it lives in MANDOS-CLIENT(8mandos) โ€” go read it again if you forgot something, no judgement, we've all been there. ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from