SYSTEMD-ASK-PASSWORD(1)
๐ SYSTEMD-ASK-PASSWORD โ bestie, it's the manual โจ
okay so this is the page for systemd-ask-password from the systemd manual set, and honestly? she's serving "ask the human for a password" and she's good at it. let's get into it ๐ซถ
๐ธ NAME ๐ธ
systemd-ask-password โ literally just: ask the user for a system password. that's the whole job. ๐
โจ SYNOPSIS โจ
systemd-ask-password [OPTIONS...] [MESSAGE]
๐ฆ DESCRIPTION ๐ฆ
so systemd-ask-password is the lil tool you use to ask a password or passphrase out of a human, interactively, with a question prompt that you pass on the command line. the way it works:
- if you run it from a TTY, it asks for the password right there on the TTY and prints it to standard output. simple. iconic.
- if you run it with no TTY at all, or with
--no-tty, it switches to a whole system-wide / per-user agent-based query mechanism โ which is fancy speak for "several agents can pop the question instead, and any active user can answer". the agents are listed below, keep reading bestie ๐
what's the point of this thing? it queries system-wide or per-user passwords โ and yes, "system-wide" includes passwords that might not even belong to a specific user account. examples, since you're gonna ask:
- unlocking encrypted hard disks when they get plugged in, or at boot ๐
- entering an SSL certificate passphrase for web and VPN servers
the existing system-level agents are:
- a boot-time password agent that asks the user using
plymouth(8) - a boot-time password agent that queries the user directly on the console โ
systemd-ask-password-console.service(8) - an agent that requests password input through a
wall(1)message โsystemd-ask-password-wall.service(8) - a TTY agent that gets temporarily spawned during
systemctl(1)invocations - a command line agent you can start temporarily to process queued password requests โ
systemd-tty-ask-password-agent --query
โ ๏ธ answering system-wide password queries is a privileged operation, no cap. that's why literally all the agents above โ except the last one โ run as privileged system services. and the last one still needs elevated privileges too, so run it through run0(1) or something similar. don't be out here raw-dogging privileges, bestie ๐ญ
more password agents can be implemented according to the systemd Password Agent Specification (link is down in NOTES, we got u).
oh and one more thing โ if a password is being queried on a TTY, the user can hit TAB to hide the asterisks that normally show up for each character typed. pressing Backspace as the first key does the same thing. cute lil privacy toggle, obsessed. ๐
๐ OPTIONS ๐
here's everything she understands, bestie. no skipping, we're doing all of them:
--icon=โ give an icon name to go with the password query. all the agents that support graphical display can use it. and pls follow the XDG Icon Naming Specification for the name (link in NOTES ๐).--id=โ sets an identifier for this specific password query. it's freely choosable, and it lets the agents involved actually recognize which query is which. pro move: include the subsystem doing the query and the specific object it's for. example:"--id=cryptsetup:/dev/sda5".
Added in version 227.
--keyname=โ configures a kernel keyring key name to use as a cache for the password. if you set it, the tool tries to push any passwords it collects into the kernel keyring of the root user, as a key with the name you gave. and if you combine it with--accept-cached, it'll also try to pull those cached passwords back out of the kernel keyring instead of bothering the user right away. the point? the kernel keyring becomes an effective cache so you're not repeatedly asking the user for passwords when multiple objects can be unlocked with the same one. the cached key gets a timeout of2.5min, after which it's purged from the kernel keyring. note that you can cache multiple passwords under the same keyname โ they'll be stored as a NUL-separated list of passwords. usekeyctl(1)to access the cached key via the kernel keyring directly. example:"--keyname=cryptsetup".
Added in version 227.
--credential=โ configure a credential to read the password from โ if it exists. this pairs nicely with theImportCredential=,LoadCredential=andSetCredential=settings in unit files; seesystemd.exec(5)for the details. if you don't specify it, it defaults to"password". heads up: this option does nothing if no credentials directory is passed to the program (i.e.$CREDENTIALS_DIRECTORYisn't set) or if no credential with the specified name exists.
Added in version 249.
--timeout=โ the query timeout, in seconds. defaults to90s. a timeout of0waits indefinitely (main character energy, no rush ๐ง).--echo=yes|no|maskedโ controls whether user input gets echoed. takes a boolean or the special string"masked", and"masked"is the default. if enabled, typed characters are echoed literally โ great for prompting for usernames and other non-protected data. if disabled, typed characters aren't echoed in any form and the user gets zero feedback on their input. if set to"masked", an asterisk ("*") is echoed for each character typed. in that mode, if the user hits the tabulator key ("โน"), echo gets turned off. (alternatively, if the user hits the backspace key ("โซ") while no data has been entered otherwise, echo gets turned off too.)
Added in version 249.
--echo,-eโ same thing as--echo=yes, see above. ๐ซ
Added in version 217.
--emoji=yes|no|autoโ controls whether the query gets prefixed with a lock and key emoji (๐) or not, if the TTY settings allow it. default is"auto", which itself defaults to"yes"โ unless--echo=yeswas given.
Added in version 249.
--no-ttyโ never ask for the password on the current TTY, even if there is one available. always use the agent system instead. periodt.--accept-cachedโ if passed, accept cached passwords, i.e. passwords that were previously entered.--multipleโ when used alongside--accept-cached, accept multiple passwords. outputs one password per line.--no-outputโ do not print passwords to standard output. useful when you want to stash a password in the kernel keyring with--keyname=but do not want it showing up on screen or in logs. stealth mode fr fr. ๐คซ
Added in version 230.
-nโ by default, when the acquired password is written to standard output it gets a newline character tacked on the end. this switch turns that off, just like the switch of the same name in theecho(1)command.
Added in version 249.
--user,--systemโ controls whether you query the system-wide password agents or the per-user ones. by default, if invoked privileged it's the system-wide agents; otherwise it's the per-user ones. these options let you override that automatic behaviour yourself.
Added in version 257.
-h,--helpโ print a short help text and exit. the classic. ๐
๐ EXIT STATUS ๐
on success, 0 comes back. anything non-zero means it failed. that's it, that's the whole vibe check.
๐ SEE ALSO ๐
systemd(1), systemd-ask-password-console.service(8), systemd-tty-ask-password-agent(1), keyctl(1), plymouth(8), wall(1)
โญ NOTES โญ
- systemd Password Agent Specification โ https://systemd.io/PASSWORD_AGENTS/
- XDG Icon Naming Specification โ https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
and that's the whole page, bestie!! this was systemd 262.1, you've been reading SYSTEMD-ASK-PASSWORD(1), and it's giving "go forth and query passwords responsibly" ๐โจ๐ฆ mwah, ily, go read the SEE ALSO list, iykyk ๐ซถ
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms