PASSWORD-AGENT(8mandos)

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

πŸ’– PASSWORD-AGENT(8mandos) πŸ’–

okay bestie, sit down, hydrate, and let me tell you about password-agent from the mandos manual (section 8, system administration commands, iykyk). this one is a lil niche but it's so important, trust.


✨ NAME ✨

password-agent β€” run the Mandos client as a systemd password agent. that's the whole vibe. it's giving "middleman with a mission" fr fr πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

password-agent [--agent-directory=DIRECTORY]
               [--helper-directory=DIRECTORY]
               [--user=USERID]
               [--group=GROUPID]
               [--] [MANDOS_CLIENT [OPTIONS...]]

password-agent --test

password-agent {--help | -?}

password-agent --usage

password-agent {--version | -V}

look at all those little ways to run it. iconic honestly. 🌸


🌈 DESCRIPTION 🌈

so password-agent is a program that's meant to be a systemd(1) "Password Agent" (peep Password Agents[1] if you wanna read the spec, nerd πŸ’–). the whole point of it β€” the entire plot of this show β€” is to acquire a password and then send that password to some other program, which will then use it to unlock the encrypted root disk. unlocking. slay. πŸ”“βœ¨

and okay, real talk: this program is not meant to be invoked directly β€” but you can run it directly anyway, if you wanna test it. lowkey encouraged for testing, highkey not for production. 🫢


πŸŽ€ PURPOSE πŸŽ€

the purpose of all this is to enable remote and unattended rebooting of a client host computer that has an encrypted root file system. yeah. your server reboots itself at 3am while you're asleep and you don't have to drive anywhere. that's the dream. πŸ’€πŸ‘‘

(see the section called "OVERVIEW" for the full tea, it's right down there.)


πŸ’… OPTIONS πŸ’…

okay here come the flags, bestie. each one is a lil gift:

  • --agent-directory DIRECTORY β€” specify a different agent directory. the default is /run/systemd/ask-password, as per the Password Agents[1] specification. πŸ—‚οΈ
  • --helper-directory DIRECTORY β€” specify a different helper directory. the default is /lib/mandos/plugin-helpers, which will exist in the initial RAM disk environment. (this will simply be passed to the MANDOS_CLIENT program via the MANDOSPLUGINHELPERDIR environment variable. see mandos-client(8mandos).) 🧰
  • --user USERID β€” change the real user ID to USERID when running MANDOS_CLIENT. the default is 65534. > note: this must be a number, not a name. bestie. a number. i'm serious. πŸ”’
  • --group GROUPID β€” change the real group ID to GROUPID when running MANDOS_CLIENT. the default is 65534. > note: again, this must be a number, not a name. don't make me say it twice (i said it twice). πŸ”’
  • MANDOS_CLIENT β€” this specifies the file name for mandos-client(8mandos). if the -- option is given, any following options are passed to the MANDOS_CLIENT program. the default is /lib/mandos/plugins.d/mandos-client (which is the correct location for the initial RAM disk environment) without any options. πŸ“
  • --help, -? β€” gives a help message about options and their meanings. your bestie when you're lost. πŸ†˜
  • --test β€” ignore normal operation; instead only run self-tests. adding the --help option may show more options possible in combination with --test. πŸ§ͺ
  • --usage β€” gives a short usage message. short king behavior. πŸ‘‘
  • --version, -V β€” prints the program version. πŸ“œ

πŸ‘‘ OVERVIEW πŸ‘‘

okay so this is part of the Mandos system, which lets computers have encrypted root file systems and still 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. and then everyone clapped. ✨

this program, password-agent, will run on the client side in the initial RAM disk environment, and is responsible for getting a password from the Mandos client program itself, and to send that password to whatever is currently asking for a password using the systemd Password Agents[1] mechanism. so it's the messenger. the go-between. the girl in the group chat relaying info. πŸ’¬

to accomplish this, password-agent runs the mandos-client program (which is the actual client program communicating with the Mandos server) or, alternatively, any executable file specified as MANDOS_CLIENT, and, as soon as a password is acquired from the MANDOS_CLIENT program, sends that password (as per the Password Agents[1] specification) to all currently unanswered password questions. all of them. every single one. no question left behind. 🫢

this program should be started (normally as a systemd service, which in turn is normally started by a systemd.path(5) file) as a reaction to files named ask.xxxx appearing in the agent directory /run/systemd/ask-password (or the directory specified by --agent-directory). so like... a file shows up and this girl goes. πŸ’¨


πŸ’€ EXIT STATUS πŸ’€

exit status of this program is zero if no errors were encountered, and otherwise not. that's it. that's the whole section. binary queen. πŸ’…


🌸 ENVIRONMENT 🌸

this program does not use any environment variables itself β€” it only passes on its environment to MANDOS_CLIENT. also, the --helper-directory option will affect the environment variable MANDOSPLUGINHELPERDIR for MANDOS_CLIENT. so it's not nosy, it's just a really good courier. 🧚


πŸ“ FILES πŸ“

  • /run/systemd/ask-password β€” the default directory to watch for password questions as per the Password Agents[1] specification; can be changed by the --agent-directory option. πŸ‘€
  • /lib/mandos/plugin-helpers β€” the helper directory as supplied to MANDOS_CLIENT via the MANDOSPLUGINHELPERDIR environment variable; can be changed by the --helper-directory option. 🧰

😭 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). so like, choose your channel wisely bestie, one of these is a group chat and one is a DM. πŸ“¨


🌈 EXAMPLE 🌈

normal invocation needs no options, she's low maintenance:

password-agent

run an alternative MANDOS_CLIENT program::

password-agent /usr/local/sbin/alternate

use alternative locations for the helper directory and the Mandos client, and add extra options suitable for running in the normal file system:

password-agent
--helper-directory=/usr/lib/x86_64-linux-gnu/mandos/plugin-helpers --
/usr/lib/x86_64-linux-gnu/mandos/plugins.d/mandos-client
--pubkey=/etc/keys/mandos/pubkey.txt
--seckey=/etc/keys/mandos/seckey.txt
--tls-pubkey=/etc/keys/mandos/tls-pubkey.pem
--tls-privkey=/etc/keys/mandos/tls-privkey.pem

use the default location for mandos-client(8mandos), but add many options to it:

password-agent -- /lib/mandos/plugins.d/mandos-client
--pubkey=/etc/mandos/keys/pubkey.txt
--seckey=/etc/mandos/keys/seckey.txt
--tls-pubkey=/etc/mandos/keys/tls-pubkey.pem
--tls-privkey=/etc/mandos/keys/tls-privkey.pem

only run the self-tests:

password-agent --test

see? ate. πŸ”₯


πŸ”₯ SECURITY πŸ”₯

this program will need to run as the root user in order to read the agent directory and the ask.xxxx files there, and will, when starting the Mandos client program, require the ability to set the "real" user and group ids to another user, by default user and group 65534, which are assumed to be non-privileged. this is done in order to match the expectations of mandos-client(8mandos), which assumes that its executable file is owned by the root user and also has the set-user-ID bit set (see execve(2)). 🚨

okay so real talk: root privileges, set-user-ID, id juggling. this is the part where you do NOT freestyle. read it twice. πŸ’€

⭐ SEE ALSO ⭐

intro(8mandos), mandos-client(8mandos), systemd(1),

  • Password Agents[1] β€” the specification for systemd "Password Agent" programs, which password-agent follows. πŸ“–

Copyright Β© 2019-2020 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/>. πŸ“œ


🧚 NOTES 🧚

  1. Password Agents β€” <https://systemd.io/PASSWORD_AGENTS/> 🌐

and that's the whole page bestie!! this was Mandos 1.8.19, dated 2020-09-16, and it's the PASSWORD-AGENT(8mandos) page. go forth, unlock your disks remotely, and stay iconic. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ‘‘

πŸ“¦ where this page comes from