]>
Commit | Line | Data |
---|---|---|
e287086b | 1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
f3bc7fdc | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
f3bc7fdc LP |
4 | |
5 | <!-- | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2011 Lennart Poettering | |
9 | ||
10 | systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
11 | under the terms of the GNU Lesser General Public License as published by |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
f3bc7fdc LP |
13 | (at your option) any later version. |
14 | ||
15 | systemd is distributed in the hope that it will be useful, but | |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
5430f7f2 | 18 | Lesser General Public License for more details. |
f3bc7fdc | 19 | |
5430f7f2 | 20 | You should have received a copy of the GNU Lesser General Public License |
f3bc7fdc LP |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
22 | --> | |
23 | ||
dfdebb1b | 24 | <refentry id="systemd-ask-password" |
798d3a52 ZJS |
25 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
26 | ||
27 | <refentryinfo> | |
28 | <title>systemd-ask-password</title> | |
29 | <productname>systemd</productname> | |
30 | ||
31 | <authorgroup> | |
32 | <author> | |
33 | <contrib>Developer</contrib> | |
34 | <firstname>Lennart</firstname> | |
35 | <surname>Poettering</surname> | |
36 | <email>lennart@poettering.net</email> | |
37 | </author> | |
38 | </authorgroup> | |
39 | </refentryinfo> | |
40 | ||
41 | <refmeta> | |
42 | <refentrytitle>systemd-ask-password</refentrytitle> | |
43 | <manvolnum>1</manvolnum> | |
44 | </refmeta> | |
45 | ||
46 | <refnamediv> | |
47 | <refname>systemd-ask-password</refname> | |
48 | <refpurpose>Query the user for a system password</refpurpose> | |
49 | </refnamediv> | |
50 | ||
51 | <refsynopsisdiv> | |
52 | <cmdsynopsis> | |
53 | <command>systemd-ask-password <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="opt">MESSAGE</arg></command> | |
54 | </cmdsynopsis> | |
55 | </refsynopsisdiv> | |
56 | ||
57 | <refsect1> | |
58 | <title>Description</title> | |
59 | ||
60 | <para><command>systemd-ask-password</command> may be used to query | |
61 | a system password or passphrase from the user, using a question | |
62 | message specified on the command line. When run from a TTY it will | |
63 | query a password on the TTY and print it to standard output. When | |
c65aafbb ZJS |
64 | run with no TTY or with <option>--no-tty</option> it will use the |
65 | system-wide query mechanism, which allows active users to respond via | |
66 | several agents, listed below.</para> | |
798d3a52 ZJS |
67 | |
68 | <para>The purpose of this tool is to query system-wide passwords | |
ccddd104 | 69 | — that is passwords not attached to a specific user account. |
798d3a52 ZJS |
70 | Examples include: unlocking encrypted hard disks when they are |
71 | plugged in or at boot, entering an SSL certificate passphrase for | |
72 | web and VPN servers.</para> | |
73 | ||
e287086b LP |
74 | <para>Existing agents are: |
75 | <itemizedlist> | |
76 | ||
77 | <listitem><para>A boot-time password agent asking the user for | |
c65aafbb ZJS |
78 | passwords using |
79 | <citerefentry project='die-net'><refentrytitle>plymouth</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
80 | </para></listitem> | |
e287086b LP |
81 | |
82 | <listitem><para>A boot-time password agent querying the user | |
c65aafbb ZJS |
83 | directly on the console — |
84 | <citerefentry><refentrytitle>systemd-ask-password-console.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
85 | </para></listitem> | |
e287086b LP |
86 | |
87 | <listitem><para>An agent requesting password input via a | |
c65aafbb ZJS |
88 | <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
89 | message — | |
90 | <citerefentry><refentrytitle>systemd-ask-password-wall.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
91 | </para></listitem> | |
e287086b LP |
92 | |
93 | <listitem><para>A TTY agent that is temporarily spawned during | |
94 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
c65aafbb ZJS |
95 | invocations,</para></listitem> |
96 | ||
97 | <listitem><para>A command line agent which can be started | |
98 | temporarily to process queued password | |
99 | requests — <command>systemd-tty-ask-password-agent --query</command>. | |
100 | </para></listitem> | |
e287086b | 101 | </itemizedlist></para> |
798d3a52 | 102 | |
c65aafbb ZJS |
103 | <para>Answering system-wide password queries is a privileged operation, hence |
104 | all the agents listed above (except for the last one), run as privileged | |
105 | system services. The last one also needs elevated privileges, so | |
106 | should be run through | |
107 | <citerefentry project='die-net'><refentrytitle>sudo</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
108 | or similar.</para> | |
109 | ||
798d3a52 ZJS |
110 | <para>Additional password agents may be implemented according to |
111 | the <ulink | |
28a0ad81 | 112 | url="https://www.freedesktop.org/wiki/Software/systemd/PasswordAgents">systemd |
798d3a52 ZJS |
113 | Password Agent Specification</ulink>.</para> |
114 | ||
115 | <para>If a password is queried on a TTY, the user may press TAB to | |
116 | hide the asterisks normally shown for each character typed. | |
117 | Pressing Backspace as first key achieves the same effect.</para> | |
118 | ||
119 | </refsect1> | |
120 | ||
121 | <refsect1> | |
122 | <title>Options</title> | |
123 | ||
124 | <para>The following options are understood:</para> | |
125 | ||
126 | <variablelist> | |
127 | <varlistentry> | |
128 | <term><option>--icon=</option></term> | |
129 | ||
130 | <listitem><para>Specify an icon name alongside the password | |
131 | query, which may be used in all agents supporting graphical | |
132 | display. The icon name should follow the <ulink | |
133 | url="http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">XDG | |
134 | Icon Naming Specification</ulink>.</para></listitem> | |
135 | </varlistentry> | |
136 | ||
e287086b LP |
137 | <varlistentry> |
138 | <term><option>--id=</option></term> | |
139 | <listitem><para>Specify an identifier for this password | |
140 | query. This identifier is freely choosable and allows | |
141 | recognition of queries by involved agents. It should include | |
142 | the subsystem doing the query and the specific object the | |
143 | query is done for. Example: | |
144 | <literal>--id=cryptsetup:/dev/sda5</literal>.</para></listitem> | |
145 | </varlistentry> | |
146 | ||
147 | <varlistentry> | |
148 | <term><option>--keyname=</option></term> | |
149 | <listitem><para>Configure a kernel keyring key name to use as | |
150 | cache for the password. If set, then the tool will try to push | |
151 | any collected passwords into the kernel keyring of the root | |
152 | user, as a key of the specified name. If combined with | |
b938cb90 | 153 | <option>--accept-cached</option>, it will also try to retrieve |
a8eaaee7 | 154 | such cached passwords from the key in the kernel keyring |
b938cb90 | 155 | instead of querying the user right away. By using this option, |
e287086b LP |
156 | the kernel keyring may be used as effective cache to avoid |
157 | repeatedly asking users for passwords, if there are multiple | |
158 | objects that may be unlocked with the same password. The | |
159 | cached key will have a timeout of 2.5min set, after which it | |
160 | will be purged from the kernel keyring. Note that it is | |
161 | possible to cache multiple passwords under the same keyname, | |
162 | in which case they will be stored as NUL-separated list of | |
163 | passwords. Use | |
524f3e5c | 164 | <citerefentry project='die-net'><refentrytitle>keyctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
e287086b LP |
165 | to access the cached key via the kernel keyring |
166 | directly. Example: <literal>--keyname=cryptsetup</literal></para></listitem> | |
167 | </varlistentry> | |
168 | ||
798d3a52 ZJS |
169 | <varlistentry> |
170 | <term><option>--timeout=</option></term> | |
171 | ||
172 | <listitem><para>Specify the query timeout in seconds. Defaults | |
173 | to 90s. A timeout of 0 waits indefinitely. </para></listitem> | |
174 | </varlistentry> | |
175 | ||
176 | <varlistentry> | |
177 | <term><option>--echo</option></term> | |
178 | ||
179 | <listitem><para>Echo the user input instead of masking it. | |
180 | This is useful when using | |
181 | <filename>systemd-ask-password</filename> to query for | |
182 | usernames. </para></listitem> | |
183 | </varlistentry> | |
184 | ||
185 | <varlistentry> | |
186 | <term><option>--no-tty</option></term> | |
187 | ||
188 | <listitem><para>Never ask for password on current TTY even if | |
189 | one is available. Always use agent system.</para></listitem> | |
190 | </varlistentry> | |
191 | ||
192 | <varlistentry> | |
193 | <term><option>--accept-cached</option></term> | |
194 | ||
195 | <listitem><para>If passed, accept cached passwords, i.e. | |
a8eaaee7 | 196 | passwords previously entered.</para></listitem> |
798d3a52 ZJS |
197 | </varlistentry> |
198 | ||
199 | <varlistentry> | |
200 | <term><option>--multiple</option></term> | |
201 | ||
202 | <listitem><para>When used in conjunction with | |
203 | <option>--accept-cached</option> accept multiple passwords. | |
204 | This will output one password per line.</para></listitem> | |
205 | </varlistentry> | |
206 | ||
a5a4e365 CH |
207 | <varlistentry> |
208 | <term><option>--no-output</option></term> | |
209 | ||
210 | <listitem><para>Do not print passwords to standard output. | |
211 | This is useful if you want to store a password in kernel | |
212 | keyring with <option>--keyname</option> but do not want it | |
213 | to show up on screen or in logs.</para></listitem> | |
214 | </varlistentry> | |
215 | ||
798d3a52 ZJS |
216 | <xi:include href="standard-options.xml" xpointer="help" /> |
217 | </variablelist> | |
218 | ||
219 | </refsect1> | |
220 | ||
221 | <refsect1> | |
222 | <title>Exit status</title> | |
223 | ||
224 | <para>On success, 0 is returned, a non-zero failure code | |
225 | otherwise.</para> | |
226 | </refsect1> | |
227 | ||
228 | <refsect1> | |
229 | <title>See Also</title> | |
230 | <para> | |
231 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
c65aafbb | 232 | <citerefentry><refentrytitle>systemd-ask-password-console.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
3f1dc090 | 233 | <citerefentry><refentrytitle>systemd-tty-ask-password-agent</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
524f3e5c | 234 | <citerefentry project='die-net'><refentrytitle>keyctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
798d3a52 ZJS |
235 | <citerefentry project='die-net'><refentrytitle>plymouth</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
236 | <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
237 | </para> | |
238 | </refsect1> | |
f3bc7fdc LP |
239 | |
240 | </refentry> |