| 1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" > |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="org.freedesktop.home1" conditional='ENABLE_HOMED' |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
<refentryinfo> |
| 9 |
<title>org.freedesktop.home1</title> |
| 10 |
<productname>systemd</productname> |
| 11 |
</refentryinfo> |
| 12 |
|
| 13 |
<refmeta> |
| 14 |
<refentrytitle>org.freedesktop.home1</refentrytitle> |
| 15 |
<manvolnum>5</manvolnum> |
| 16 |
</refmeta> |
| 17 |
|
| 18 |
<refnamediv> |
| 19 |
<refname>org.freedesktop.home1</refname> |
| 20 |
<refpurpose>The D-Bus interface of systemd-homed</refpurpose> |
| 21 |
</refnamediv> |
| 22 |
|
| 23 |
<refsect1> |
| 24 |
<title>Introduction</title> |
| 25 |
|
| 26 |
<para><citerefentry><refentrytitle>systemd-homed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 27 |
is a system service which may be used to create, remove, change or inspect home areas. This page |
| 28 |
describes the D-Bus interface. |
| 29 |
</para> |
| 30 |
</refsect1> |
| 31 |
|
| 32 |
<refsect1> |
| 33 |
<title>The Manager Object</title> |
| 34 |
|
| 35 |
<para>The service exposes the following interfaces on the Manager object on the bus:</para> |
| 36 |
|
| 37 |
<programlisting executable="systemd-homed" node="/org/freedesktop/home1" interface="org.freedesktop.home1.Manager"> |
| 38 |
node /org/freedesktop/home1 { |
| 39 |
interface org.freedesktop.home1.Manager { |
| 40 |
methods: |
| 41 |
GetHomeByName(in s user_name, |
| 42 |
out u uid, |
| 43 |
out s home_state, |
| 44 |
out u gid, |
| 45 |
out s real_name, |
| 46 |
out s home_directory, |
| 47 |
out s shell, |
| 48 |
out o bus_path); |
| 49 |
GetHomeByUID(in u uid, |
| 50 |
out s user_name, |
| 51 |
out s home_state, |
| 52 |
out u gid, |
| 53 |
out s real_name, |
| 54 |
out s home_directory, |
| 55 |
out s shell, |
| 56 |
out o bus_path); |
| 57 |
GetUserRecordByName(in s user_name, |
| 58 |
out s user_record, |
| 59 |
out b incomplete, |
| 60 |
out o bus_path); |
| 61 |
GetUserRecordByUID(in u uid, |
| 62 |
out s user_record, |
| 63 |
out b incomplete, |
| 64 |
out o bus_path); |
| 65 |
ListHomes(out a(susussso) home_areas); |
| 66 |
ActivateHome(in s user_name, |
| 67 |
in s secret); |
| 68 |
ActivateHomeIfReferenced(in s user_name, |
| 69 |
in s secret); |
| 70 |
@org.freedesktop.systemd1.Privileged("true") |
| 71 |
DeactivateHome(in s user_name); |
| 72 |
RegisterHome(in s user_record); |
| 73 |
AdoptHome(in s image_path, |
| 74 |
in t flags); |
| 75 |
UnregisterHome(in s user_name); |
| 76 |
CreateHome(in s user_record); |
| 77 |
CreateHomeEx(in s user_record, |
| 78 |
in a{sh} blobs, |
| 79 |
in t flags); |
| 80 |
RealizeHome(in s user_name, |
| 81 |
in s secret); |
| 82 |
RemoveHome(in s user_name); |
| 83 |
@org.freedesktop.systemd1.Privileged("true") |
| 84 |
FixateHome(in s user_name, |
| 85 |
in s secret); |
| 86 |
AuthenticateHome(in s user_name, |
| 87 |
in s secret); |
| 88 |
UpdateHome(in s user_record); |
| 89 |
UpdateHomeEx(in s user_record, |
| 90 |
in a{sh} blobs, |
| 91 |
in t flags); |
| 92 |
ResizeHome(in s user_name, |
| 93 |
in t size, |
| 94 |
in s secret); |
| 95 |
ChangePasswordHome(in s user_name, |
| 96 |
in s new_secret, |
| 97 |
in s old_secret); |
| 98 |
@org.freedesktop.systemd1.Privileged("true") |
| 99 |
LockHome(in s user_name); |
| 100 |
@org.freedesktop.systemd1.Privileged("true") |
| 101 |
UnlockHome(in s user_name, |
| 102 |
in s secret); |
| 103 |
AcquireHome(in s user_name, |
| 104 |
in s secret, |
| 105 |
in b please_suspend, |
| 106 |
out h send_fd); |
| 107 |
@org.freedesktop.systemd1.Privileged("true") |
| 108 |
RefHome(in s user_name, |
| 109 |
in b please_suspend, |
| 110 |
out h send_fd); |
| 111 |
@org.freedesktop.systemd1.Privileged("true") |
| 112 |
RefHomeUnrestricted(in s user_name, |
| 113 |
in b please_suspend, |
| 114 |
out h send_fd); |
| 115 |
@org.freedesktop.systemd1.Privileged("true") |
| 116 |
ReleaseHome(in s user_name); |
| 117 |
ListSigningKeys(out a(sst) keys); |
| 118 |
GetSigningKey(in s name, |
| 119 |
out s der, |
| 120 |
out t flags); |
| 121 |
AddSigningKey(in s name, |
| 122 |
in s pem, |
| 123 |
in t flags); |
| 124 |
RemoveSigningKey(in s name, |
| 125 |
in t flags); |
| 126 |
@org.freedesktop.systemd1.Privileged("true") |
| 127 |
LockAllHomes(); |
| 128 |
@org.freedesktop.systemd1.Privileged("true") |
| 129 |
DeactivateAllHomes(); |
| 130 |
@org.freedesktop.systemd1.Privileged("true") |
| 131 |
Rebalance(); |
| 132 |
properties: |
| 133 |
readonly a(sso) AutoLogin = [...]; |
| 134 |
}; |
| 135 |
interface org.freedesktop.DBus.Peer { ... }; |
| 136 |
interface org.freedesktop.DBus.Introspectable { ... }; |
| 137 |
interface org.freedesktop.DBus.Properties { ... }; |
| 138 |
}; |
| 139 |
</programlisting> |
| 140 |
|
| 141 |
<!--Autogenerated cross-references for systemd.directives, do not edit--> |
| 142 |
|
| 143 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.home1.Manager"/> |
| 144 |
|
| 145 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.home1.Manager"/> |
| 146 |
|
| 147 |
<variablelist class="dbus-method" generated="True" extra-ref="GetHomeByName()"/> |
| 148 |
|
| 149 |
<variablelist class="dbus-method" generated="True" extra-ref="GetHomeByUID()"/> |
| 150 |
|
| 151 |
<variablelist class="dbus-method" generated="True" extra-ref="GetUserRecordByName()"/> |
| 152 |
|
| 153 |
<variablelist class="dbus-method" generated="True" extra-ref="GetUserRecordByUID()"/> |
| 154 |
|
| 155 |
<variablelist class="dbus-method" generated="True" extra-ref="ListHomes()"/> |
| 156 |
|
| 157 |
<variablelist class="dbus-method" generated="True" extra-ref="ActivateHome()"/> |
| 158 |
|
| 159 |
<variablelist class="dbus-method" generated="True" extra-ref="ActivateHomeIfReferenced()"/> |
| 160 |
|
| 161 |
<variablelist class="dbus-method" generated="True" extra-ref="DeactivateHome()"/> |
| 162 |
|
| 163 |
<variablelist class="dbus-method" generated="True" extra-ref="RegisterHome()"/> |
| 164 |
|
| 165 |
<variablelist class="dbus-method" generated="True" extra-ref="AdoptHome()"/> |
| 166 |
|
| 167 |
<variablelist class="dbus-method" generated="True" extra-ref="UnregisterHome()"/> |
| 168 |
|
| 169 |
<variablelist class="dbus-method" generated="True" extra-ref="CreateHome()"/> |
| 170 |
|
| 171 |
<variablelist class="dbus-method" generated="True" extra-ref="CreateHomeEx()"/> |
| 172 |
|
| 173 |
<variablelist class="dbus-method" generated="True" extra-ref="RealizeHome()"/> |
| 174 |
|
| 175 |
<variablelist class="dbus-method" generated="True" extra-ref="RemoveHome()"/> |
| 176 |
|
| 177 |
<variablelist class="dbus-method" generated="True" extra-ref="FixateHome()"/> |
| 178 |
|
| 179 |
<variablelist class="dbus-method" generated="True" extra-ref="AuthenticateHome()"/> |
| 180 |
|
| 181 |
<variablelist class="dbus-method" generated="True" extra-ref="UpdateHome()"/> |
| 182 |
|
| 183 |
<variablelist class="dbus-method" generated="True" extra-ref="UpdateHomeEx()"/> |
| 184 |
|
| 185 |
<variablelist class="dbus-method" generated="True" extra-ref="ResizeHome()"/> |
| 186 |
|
| 187 |
<variablelist class="dbus-method" generated="True" extra-ref="ChangePasswordHome()"/> |
| 188 |
|
| 189 |
<variablelist class="dbus-method" generated="True" extra-ref="LockHome()"/> |
| 190 |
|
| 191 |
<variablelist class="dbus-method" generated="True" extra-ref="UnlockHome()"/> |
| 192 |
|
| 193 |
<variablelist class="dbus-method" generated="True" extra-ref="AcquireHome()"/> |
| 194 |
|
| 195 |
<variablelist class="dbus-method" generated="True" extra-ref="RefHome()"/> |
| 196 |
|
| 197 |
<variablelist class="dbus-method" generated="True" extra-ref="RefHomeUnrestricted()"/> |
| 198 |
|
| 199 |
<variablelist class="dbus-method" generated="True" extra-ref="ReleaseHome()"/> |
| 200 |
|
| 201 |
<variablelist class="dbus-method" generated="True" extra-ref="ListSigningKeys()"/> |
| 202 |
|
| 203 |
<variablelist class="dbus-method" generated="True" extra-ref="GetSigningKey()"/> |
| 204 |
|
| 205 |
<variablelist class="dbus-method" generated="True" extra-ref="AddSigningKey()"/> |
| 206 |
|
| 207 |
<variablelist class="dbus-method" generated="True" extra-ref="RemoveSigningKey()"/> |
| 208 |
|
| 209 |
<variablelist class="dbus-method" generated="True" extra-ref="LockAllHomes()"/> |
| 210 |
|
| 211 |
<variablelist class="dbus-method" generated="True" extra-ref="DeactivateAllHomes()"/> |
| 212 |
|
| 213 |
<variablelist class="dbus-method" generated="True" extra-ref="Rebalance()"/> |
| 214 |
|
| 215 |
<variablelist class="dbus-property" generated="True" extra-ref="AutoLogin"/> |
| 216 |
|
| 217 |
<!--End of Autogenerated section--> |
| 218 |
|
| 219 |
<refsect2> |
| 220 |
<title>Methods</title> |
| 221 |
|
| 222 |
<para><function>GetHomeByName()</function> returns basic user information (a minimal subset of the full |
| 223 |
user record), provided a user name. The information supplied more or less matches what |
| 224 |
<citerefentry project="man-pages"><refentrytitle>getpwnam</refentrytitle><manvolnum>3</manvolnum></citerefentry> returns: |
| 225 |
the numeric UID and GID, the real name, home directory and shell. In addition it returns a state |
| 226 |
identifier describing the state the user's home directory is in, as well as a bus path referring to the |
| 227 |
bus object encapsulating the user record and home directory. This object implements the |
| 228 |
<classname>org.freedesktop.home1.Home</classname> interface documented below. This method, and most others |
| 229 |
in this interface that take user names, will try to use the caller's home area if the specified user name is |
| 230 |
an empty string.</para> |
| 231 |
|
| 232 |
<para><function>GetHomeByUID()</function> is similar to <function>GetHomeByName()</function> but |
| 233 |
acquires the information based on the numeric UID of the user.</para> |
| 234 |
|
| 235 |
<para><function>GetUserRecordByName()</function> is also similar to |
| 236 |
<function>GetHomeByName()</function> but returns the full JSON user record data instead of the broken |
| 237 |
down records. An additional returned boolean indicates whether the record is complete or not. A record |
| 238 |
is considered complete when its <literal>privileged</literal> section is included, and incomplete if it |
| 239 |
was removed (see <ulink url="https://systemd.io/USER_RECORD">JSON User Records</ulink> for details |
| 240 |
about the various sections of a user record). Generally, only privileged clients and clients running |
| 241 |
under the identity of the user itself get access to the <literal>privileged</literal> section and will |
| 242 |
thus see complete records.</para> |
| 243 |
|
| 244 |
<para><function>GetUserRecordByUID()</function> is similar to <function>GetUserRecordByName()</function> |
| 245 |
but returns the user record matching the specified numeric UID.</para> |
| 246 |
|
| 247 |
<para><function>ListHomes()</function> returns an array of all locally managed users. The array |
| 248 |
contains the same fields <function>GetHomeByName()</function> returns: user name, numeric UID, state, |
| 249 |
numeric GID, real name, home directory, shell and bus path of the matching bus object.</para> |
| 250 |
|
| 251 |
<para><function>ActivateHome()</function> activates (i.e. mounts) the home directory of the specified |
| 252 |
user. The second argument shall contain a user record consisting only of a <literal>secret</literal> |
| 253 |
section (all other sections should be stripped, see <ulink url="https://systemd.io/USER_RECORD">JSON |
| 254 |
User Records</ulink> for details), and should contain only the secret credentials necessary for |
| 255 |
unlocking the home directory. Typically a client would invoke this function first with an entirely |
| 256 |
empty record (which is possibly sufficient if single-factor authentication with a plugged-in security |
| 257 |
token is configured), and would then retry with a record populated with more information, depending on |
| 258 |
the returned error code, in case more credentials are necessary. This function is synchronous and |
| 259 |
returns only after the home directory was fully activated (or the operation failed), which might take |
| 260 |
some time. Clients must be prepared for that, and typically should extend the D-Bus method call |
| 261 |
timeout accordingly. This method is equivalent to the <function>Activate()</function> method on the |
| 262 |
<classname>org.freedesktop.home1.Home</classname> interface documented below, but may be called on the |
| 263 |
manager object and takes a user name as additional argument, instead.</para> |
| 264 |
|
| 265 |
<para><function>ActivateHomeIfReferenced()</function> is identical to |
| 266 |
<function>ActivateHome()</function>. However, the call only succeeds if the home directory is currently |
| 267 |
referenced. Useful in conjunction with <function>RefHomeUnrestricted()</function>, which allows |
| 268 |
creating a reference to a home directory even if the home directory is not active.</para> |
| 269 |
|
| 270 |
<para><function>DeactivateHome()</function> deactivates (i.e. unmounts) the home directory of the |
| 271 |
specified user. It is equivalent to the <function>Deactivate()</function> method on the |
| 272 |
<classname>org.freedesktop.home1.Home</classname> interface documented below.</para> |
| 273 |
|
| 274 |
<para><function>RegisterHome()</function> registers a new home directory locally. It receives the JSON |
| 275 |
user record as only argument (which typically excludes the <literal>secret</literal> |
| 276 |
section). Registering a home directory just makes the user record known to the system, it does not |
| 277 |
create a home directory or such (which is expected to exist already, or created later). This operation |
| 278 |
is useful to register home directories locally that are not located where |
| 279 |
<filename>systemd-homed.service</filename> would find them automatically.</para> |
| 280 |
|
| 281 |
<para><function>AdoptHome()</function> also registers a new home directory locally. It takes a path to |
| 282 |
a home directory itself, and will register it locally. This only works for <filename>*.home</filename> |
| 283 |
and <filename>*.homedir/</filename> home directories. This operation is done automatically for all such |
| 284 |
home areas showing up in <filename>/home/</filename>, but may be requested explicitly with this call for |
| 285 |
directories elsewhere. The <varname>flags</varname> must be set to zero, currently.</para> |
| 286 |
|
| 287 |
<para><function>UnregisterHome()</function> unregisters an existing home directory. It takes a user |
| 288 |
name as argument and undoes what <function>RegisterHome()</function> does. It does not attempt to |
| 289 |
remove the home directory itself, it just unregisters it with the local system. Note that if the home |
| 290 |
directory is placed where <filename>systemd-homed.service</filename> looks for home directories anyway |
| 291 |
this call will only undo fixation (see below), but the record will remain known to |
| 292 |
<filename>systemd-homed.service</filename> and be listed among known records. Since the user record is |
| 293 |
embedded into the home directory this operation generally does not discard data belonging to the user |
| 294 |
or their record. This method is equivalent to |
| 295 |
<function>Unregister()</function> on the <classname>org.freedesktop.home1.Home</classname> |
| 296 |
interface.</para> |
| 297 |
|
| 298 |
<para><function>CreateHome()</function> registers and creates a new home directory. This takes a fully |
| 299 |
specified JSON user record as argument (including the <literal>secret</literal> section). This registers |
| 300 |
the user record locally and creates a home directory matching it, depending on the settings specified |
| 301 |
in the record in combination with local configuration.</para> |
| 302 |
|
| 303 |
<para><function>CreateHomeEx()</function> is like <function>CreateHome()</function>, but it allows the |
| 304 |
home directory to be created with a pre-populated blob directory (see |
| 305 |
<ulink url="https://systemd.io/USER_RECORD_BLOB_DIRS">User Record Blob Directories</ulink> for more info). |
| 306 |
This can be done via the dictionary passed as the <varname>blobs</varname> argument to this method: the values |
| 307 |
are open file descriptors to regular files, and the keys are the filenames that should contain their respective |
| 308 |
file's data in the blob directory. Note that for security reasons, the file descriptors passed into this method |
| 309 |
must have enough privileges to read their target file and thus cannot be <literal>O_PATH</literal>; this |
| 310 |
is done to ensure the caller is actually permitted to read the file they are asking to publish in the |
| 311 |
blob directories. If the user record passed as the first argument contains a <literal>blobManifest</literal> |
| 312 |
field it will be enforced; otherwise, a <literal>blobManifest</literal> field will be generated and inserted |
| 313 |
into the record. The <varname>flags</varname> argument may be used for future expansion, but for now |
| 314 |
pass 0.</para> |
| 315 |
|
| 316 |
<para><function>RealizeHome()</function> creates a home directory whose user record is already |
| 317 |
registered locally. This takes a user name plus a user record consisting only of the |
| 318 |
<literal>secret</literal> section. Invoking <function>RegisterHome()</function> followed by |
| 319 |
<function>RealizeHome()</function> is mostly equivalent to calling <function>CreateHome()</function>, |
| 320 |
except that the latter combines the two in atomic fashion. This method is equivalent to |
| 321 |
<function>Realize()</function> on the <classname>org.freedesktop.home1.Home</classname> |
| 322 |
interface.</para> |
| 323 |
|
| 324 |
<para><function>RemoveHome()</function> unregisters a user record locally, and removes the home |
| 325 |
directory belonging to it, if it is accessible. It takes a user name as argument. This method is equivalent to |
| 326 |
<function>Remove()</function> on the <classname>org.freedesktop.home1.Home</classname> |
| 327 |
interface.</para> |
| 328 |
|
| 329 |
<para><function>FixateHome()</function> <literal>fixates</literal> an automatically discovered home |
| 330 |
directory. <filename>systemd-homed.service</filename> automatically discovers home directories dropped |
| 331 |
in our plugged in and adds them to the runtime list of user records it manages. A user record |
| 332 |
discovered that way may be <literal>fixated</literal>, in which case it is copied out of the home |
| 333 |
directory, onto persistent storage, to fixate the UID/GID assignment of the record, and extract |
| 334 |
additional (typically previously encrypted) user record data from the home directory. A home directory |
| 335 |
mus be fixated before it can be logged into. This method call takes a user name and a JSON user record |
| 336 |
consisting only of the <literal>secret</literal> section as argument. This method is equivalent to |
| 337 |
<function>Fixate()</function> on the <classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 338 |
|
| 339 |
<para><function>AuthenticateHome()</function> checks passwords or other authentication credentials |
| 340 |
associated with the home directory. It takes a user name and a JSON user record consisting only of the |
| 341 |
<literal>secret</literal> section as argument. Note that many of the other method calls authenticate |
| 342 |
the user first, in order to execute some other operation. This method call only authenticates and |
| 343 |
executes no further operation. Like <function>ActivateHome()</function> it is usually first invoked |
| 344 |
with an empty JSON user record, which is then populated for subsequent tries with additional |
| 345 |
authentication data supplied. This method is equivalent to |
| 346 |
<function>Authenticate()</function> on the <classname>org.freedesktop.home1.Home</classname> |
| 347 |
interface.</para> |
| 348 |
|
| 349 |
<para><function>UpdateHome()</function> updates a locally registered user record. Takes a fully |
| 350 |
specified JSON user record as argument (possibly including the <literal>secret</literal> section). A user |
| 351 |
with a matching name and realm must be registered locally already, and the last change timestamp of the |
| 352 |
newly supplied record must be newer than the previously existing user record. Note this operation updates |
| 353 |
the user record only, it does not propagate passwords/authentication tokens from the user record to the |
| 354 |
storage back-end, or resizes the storage back-end. Typically a home directory is first updated, and then |
| 355 |
the password of the underlying storage updated using <function>ChangePasswordHome()</function> as well |
| 356 |
as the storage resized using <function>ResizeHome()</function>. This method is equivalent to |
| 357 |
<function>Update()</function> on the <classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 358 |
|
| 359 |
<para><function>UpdateHomeEx()</function> is like <function>UpdateHome()</function>, but it allows for |
| 360 |
changes to the blob directory (see <ulink url="https://systemd.io/USER_RECORD_BLOB_DIRS">User Record Blob |
| 361 |
Directories</ulink> for more info). The <varname>blobs</varname> argument works in the same way as |
| 362 |
<function>CreateHomeEx()</function>, so check there for details. The new blob directory contents passed into |
| 363 |
this method will completely replace the user's existing blob directory. The <varname>flags</varname> argument |
| 364 |
can be used to further customize the behavior of this method via flags defined as follows:</para> |
| 365 |
<programlisting> |
| 366 |
#define SD_HOMED_UPDATE_OFFLINE (UINT64_C(1) << 0) |
| 367 |
</programlisting> |
| 368 |
<para>When <constant>SD_HOMED_UPDATE_OFFLINE</constant> (0x01) is set, no attempt is made to update the copies |
| 369 |
of the user record and blob directory that are embedded into the home directory. Changes will be stored, however, |
| 370 |
and may be propagated into the home directory the next time it is reconciled (most likely when the user next logs in). |
| 371 |
Note that any changes made with this flag set may be lost if the home area has a newer record, which can happen |
| 372 |
if the home area is updated on another machine after this method call. This method is equivalent to |
| 373 |
<function>UpdateEx()</function> on the <classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 374 |
|
| 375 |
<para><function>ResizeHome()</function> resizes the storage associated with a user record. Takes a user |
| 376 |
name, a disk size in bytes, and optionally a user record consisting only of the <literal>secret</literal> |
| 377 |
section as arguments. If the size is specified as <constant>UINT64_MAX</constant> the storage is resized to |
| 378 |
the size already specified in the user record. Typically, if the user record is updated using |
| 379 |
<function>UpdateHome()</function> above this is used to propagate the size configured there-in down to |
| 380 |
the underlying storage back-end. This method is equivalent to <function>Resize()</function> on the |
| 381 |
<classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 382 |
|
| 383 |
<para><function>ChangePasswordHome()</function> changes the passwords/authentication tokens of a home |
| 384 |
directory. Takes a user name, and two JSON user record objects, each consisting only of the |
| 385 |
<literal>secret</literal> section, for the old and for the new passwords/authentication tokens. If the |
| 386 |
user record with the new passwords/authentication token data is specified as empty the existing user |
| 387 |
record's settings are propagated down to the home directory storage. This is typically used after a |
| 388 |
user record is updated using <function>UpdateHome()</function> in order to propagate the |
| 389 |
secrets/authentication tokens down to the storage. Background: depending on the backend the user's |
| 390 |
authentication credentials are stored at multiple places: the user record kept on the host, the user |
| 391 |
record kept in the home directory and the encrypted LUKS volume slot. If the home directory is used on |
| 392 |
a different machined temporarily, and the password is changed there, and then is moved back to the |
| 393 |
original host, the passwords of the three might get out of sync. By issuing |
| 394 |
<function>ChangePasswordHome()</function> the three locations are updated to match the newest |
| 395 |
information. This method is equivalent to <function>ChangePassword()</function> on the |
| 396 |
<classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 397 |
|
| 398 |
<para><function>LockHome()</function> temporarily suspends access to a home directory, flushing out any |
| 399 |
cryptographic keys from memory. This is only supported on some back-ends, and is usually done during system |
| 400 |
suspend, in order to effectively secure home directories while the system is sleeping. Takes a user |
| 401 |
name as single argument. If an application attempts to access a home directory while it is locked it |
| 402 |
will typically freeze until the home directory is unlocked again. This method is equivalent to |
| 403 |
<function>Lock()</function> on the <classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 404 |
|
| 405 |
<para><function>UnlockHome()</function> undoes the effect of <function>LockHome()</function>. Takes a |
| 406 |
user name and a user record consisting only of the <literal>secret</literal> section as arguments. This |
| 407 |
method is equivalent to <function>Unlock()</function> on the |
| 408 |
<classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 409 |
|
| 410 |
<para><function>AcquireHome()</function> activates or unlocks a home directory in a reference counted |
| 411 |
mode of operation. Takes a user name and user record consisting only of <literal>secret</literal> |
| 412 |
section as argument. If the home directory is not active yet, it is activated. If it is currently |
| 413 |
locked it is unlocked. After completion a reference to the activation/unlocking of the home directory |
| 414 |
is returned via a file descriptor. When the last client which acquired such a file descriptor closes it |
| 415 |
the home directory is automatically deactivated again. This method is typically invoked when a user |
| 416 |
logs in, and the file descriptor is held until the user logs out again, thus ensuring the user's home |
| 417 |
directory can be unmounted automatically again in a robust fashion, when the user logs out. The third |
| 418 |
argument is a boolean which indicates whether the client invoking the call is able to automatically |
| 419 |
re-authenticate when the system comes back from suspending. It should be set by all clients that |
| 420 |
implement a secure lock screen running outside of the user's context, that is brought up when the |
| 421 |
system comes back from suspend and can be used to re-acquire the credentials to unlock the user's home |
| 422 |
directory. If a home directory has at least one client with an open reference to the home directory |
| 423 |
that does not support this it is not suspended automatically at system suspend, otherwise it is. This |
| 424 |
method is equivalent to <function>Acquire()</function> on the |
| 425 |
<classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 426 |
|
| 427 |
<para><function>RefHome()</function> is similar to <function>AcquireHome()</function> but takes no user |
| 428 |
record with <literal>secret</literal> section, i.e. will take an additional reference to an already |
| 429 |
activated/unlocked home directory without attempting to activate/unlock it itself. It will fail if the |
| 430 |
home directory is not already activated. This method is equivalent to |
| 431 |
<function>Ref()</function> on the <classname>org.freedesktop.home1.Home</classname> |
| 432 |
interface.</para> |
| 433 |
|
| 434 |
<para><function>RefHomeUnrestricted()</function> is identical to <function>RefHome()</function> but |
| 435 |
succeeds even if the home area is not active currently. This is useful on conjunction with |
| 436 |
<function>ActivateHomeIfReferenced()</function>.</para> |
| 437 |
|
| 438 |
<para><function>ReleaseHome()</function> releases a home directory again, if all file descriptors |
| 439 |
referencing it are already closed, that where acquired through <function>AcquireHome()</function> or |
| 440 |
<function>RefHome()</function>. Note that this call does not actually cause the deactivation of the |
| 441 |
home directory (which happens automatically when the last referencing file descriptor is closed), but |
| 442 |
is simply a synchronization mechanism that allows delaying of the user session's termination until any |
| 443 |
triggered deactivation is completed. This method is equivalent to <function>Release()</function> on the |
| 444 |
<classname>org.freedesktop.home1.Home</classname> interface.</para> |
| 445 |
|
| 446 |
<para><function>LockAllHomes()</function> locks all active home directories that only have references |
| 447 |
that opted into automatic suspending during system suspend. This is usually invoked automatically |
| 448 |
shortly before system suspend.</para> |
| 449 |
|
| 450 |
<para><function>DeactivateAllHomes()</function> deactivates all home areas that are currently |
| 451 |
active. This is usually invoked automatically shortly before system shutdown.</para> |
| 452 |
|
| 453 |
<para><function>Rebalance()</function> synchronously rebalances free disk space between home |
| 454 |
areas. This only executes an operation if at least one home area using the LUKS2 backend is active and |
| 455 |
has rebalancing enabled, and is otherwise a NOP.</para> |
| 456 |
|
| 457 |
<para><function>ListSigningKeys()</function> acquires a list of installed home area signing |
| 458 |
keys. Returns an array of key names with their PEM encoded public key data. Each entry also comes with |
| 459 |
a flags value which is currently unused and should be ignored by clients.</para> |
| 460 |
|
| 461 |
<para><function>GetSigningKey()</function> acquires the PEM encoded public part of the specified home |
| 462 |
area signing key of the specified name. Also returns a currently unused flags value that should be |
| 463 |
ignored. The <varname>flags</varname> parameter must be set to zero, currently.</para> |
| 464 |
|
| 465 |
<para><function>AddSigningKey()</function> adds a new key to the list of home area signing keys. Takes |
| 466 |
a name string (free-form, suitable as filename, with suffix <literal>.public</literal>), the PEM |
| 467 |
encoded public key data and a currently unused flags value that must be zero. The |
| 468 |
<varname>flags</varname> parameter must be set to zero, currently.</para> |
| 469 |
|
| 470 |
<para><function>RemoveSigningKey()</function> removes a key from the list of home area signing |
| 471 |
keys. Takes the name of the key to remove and a currently unused flags value that must be zero. The |
| 472 |
<varname>flags</varname> parameter must be set to zero, currently.</para> |
| 473 |
</refsect2> |
| 474 |
|
| 475 |
<refsect2> |
| 476 |
<title>Properties</title> |
| 477 |
|
| 478 |
<para><varname>AutoLogin</varname> exposes an array of structures consisting of user name, seat name |
| 479 |
and object path of an home directory object. All locally managed users that have the |
| 480 |
<literal>autoLogin</literal> field set are listed here, with the seat name they are associated with. A |
| 481 |
display manager may watch this property and pre-fill the login screen with the users exposed this |
| 482 |
way.</para> |
| 483 |
</refsect2> |
| 484 |
</refsect1> |
| 485 |
|
| 486 |
<refsect1> |
| 487 |
<title>The Home Object</title> |
| 488 |
|
| 489 |
<programlisting executable="systemd-homed" node="/org/freedesktop/home1/home" interface="org.freedesktop.home1.Home"> |
| 490 |
node /org/freedesktop/home1/home { |
| 491 |
interface org.freedesktop.home1.Home { |
| 492 |
methods: |
| 493 |
Activate(in s secret); |
| 494 |
ActivateIfReferenced(in s secret); |
| 495 |
@org.freedesktop.systemd1.Privileged("true") |
| 496 |
Deactivate(); |
| 497 |
Unregister(); |
| 498 |
Realize(in s secret); |
| 499 |
Remove(); |
| 500 |
@org.freedesktop.systemd1.Privileged("true") |
| 501 |
Fixate(in s secret); |
| 502 |
Authenticate(in s secret); |
| 503 |
Update(in s user_record); |
| 504 |
UpdateEx(in s user_record, |
| 505 |
in a{sh} blobs, |
| 506 |
in t flags); |
| 507 |
Resize(in t size, |
| 508 |
in s secret); |
| 509 |
ChangePassword(in s new_secret, |
| 510 |
in s old_secret); |
| 511 |
@org.freedesktop.systemd1.Privileged("true") |
| 512 |
Lock(); |
| 513 |
@org.freedesktop.systemd1.Privileged("true") |
| 514 |
Unlock(in s secret); |
| 515 |
@org.freedesktop.systemd1.Privileged("true") |
| 516 |
Acquire(in s secret, |
| 517 |
in b please_suspend, |
| 518 |
out h send_fd); |
| 519 |
@org.freedesktop.systemd1.Privileged("true") |
| 520 |
Ref(in b please_suspend, |
| 521 |
out h send_fd); |
| 522 |
@org.freedesktop.systemd1.Privileged("true") |
| 523 |
RefUnrestricted(in b please_suspend, |
| 524 |
out h send_fd); |
| 525 |
@org.freedesktop.systemd1.Privileged("true") |
| 526 |
Release(); |
| 527 |
properties: |
| 528 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("const") |
| 529 |
readonly s UserName = '...'; |
| 530 |
readonly u UID = ...; |
| 531 |
readonly (suusss) UnixRecord = ...; |
| 532 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("false") |
| 533 |
readonly s State = '...'; |
| 534 |
@org.freedesktop.DBus.Property.EmitsChangedSignal("invalidates") |
| 535 |
readonly (sb) UserRecord = ...; |
| 536 |
}; |
| 537 |
interface org.freedesktop.DBus.Peer { ... }; |
| 538 |
interface org.freedesktop.DBus.Introspectable { ... }; |
| 539 |
interface org.freedesktop.DBus.Properties { ... }; |
| 540 |
interface org.freedesktop.DBus.ObjectManager { ... }; |
| 541 |
}; |
| 542 |
</programlisting> |
| 543 |
|
| 544 |
<!--Autogenerated cross-references for systemd.directives, do not edit--> |
| 545 |
|
| 546 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.DBus.ObjectManager"/> |
| 547 |
|
| 548 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.home1.Home"/> |
| 549 |
|
| 550 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.DBus.ObjectManager"/> |
| 551 |
|
| 552 |
<variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.home1.Home"/> |
| 553 |
|
| 554 |
<variablelist class="dbus-method" generated="True" extra-ref="Activate()"/> |
| 555 |
|
| 556 |
<variablelist class="dbus-method" generated="True" extra-ref="ActivateIfReferenced()"/> |
| 557 |
|
| 558 |
<variablelist class="dbus-method" generated="True" extra-ref="Deactivate()"/> |
| 559 |
|
| 560 |
<variablelist class="dbus-method" generated="True" extra-ref="Unregister()"/> |
| 561 |
|
| 562 |
<variablelist class="dbus-method" generated="True" extra-ref="Realize()"/> |
| 563 |
|
| 564 |
<variablelist class="dbus-method" generated="True" extra-ref="Remove()"/> |
| 565 |
|
| 566 |
<variablelist class="dbus-method" generated="True" extra-ref="Fixate()"/> |
| 567 |
|
| 568 |
<variablelist class="dbus-method" generated="True" extra-ref="Authenticate()"/> |
| 569 |
|
| 570 |
<variablelist class="dbus-method" generated="True" extra-ref="Update()"/> |
| 571 |
|
| 572 |
<variablelist class="dbus-method" generated="True" extra-ref="UpdateEx()"/> |
| 573 |
|
| 574 |
<variablelist class="dbus-method" generated="True" extra-ref="Resize()"/> |
| 575 |
|
| 576 |
<variablelist class="dbus-method" generated="True" extra-ref="ChangePassword()"/> |
| 577 |
|
| 578 |
<variablelist class="dbus-method" generated="True" extra-ref="Lock()"/> |
| 579 |
|
| 580 |
<variablelist class="dbus-method" generated="True" extra-ref="Unlock()"/> |
| 581 |
|
| 582 |
<variablelist class="dbus-method" generated="True" extra-ref="Acquire()"/> |
| 583 |
|
| 584 |
<variablelist class="dbus-method" generated="True" extra-ref="Ref()"/> |
| 585 |
|
| 586 |
<variablelist class="dbus-method" generated="True" extra-ref="RefUnrestricted()"/> |
| 587 |
|
| 588 |
<variablelist class="dbus-method" generated="True" extra-ref="Release()"/> |
| 589 |
|
| 590 |
<variablelist class="dbus-property" generated="True" extra-ref="UserName"/> |
| 591 |
|
| 592 |
<variablelist class="dbus-property" generated="True" extra-ref="UID"/> |
| 593 |
|
| 594 |
<variablelist class="dbus-property" generated="True" extra-ref="UnixRecord"/> |
| 595 |
|
| 596 |
<variablelist class="dbus-property" generated="True" extra-ref="State"/> |
| 597 |
|
| 598 |
<variablelist class="dbus-property" generated="True" extra-ref="UserRecord"/> |
| 599 |
|
| 600 |
<!--End of Autogenerated section--> |
| 601 |
|
| 602 |
<refsect2> |
| 603 |
<title>Methods</title> |
| 604 |
|
| 605 |
<para><function>Activate()</function>, <function>ActivateIfReferenced()</function>, |
| 606 |
<function>Deactivate()</function>, <function>Unregister()</function>, <function>Realize()</function>, |
| 607 |
<function>Remove()</function>, <function>Fixate()</function>, <function>Authenticate()</function>, |
| 608 |
<function>Update()</function>, <function>UpdateEx()</function>, <function>Resize()</function>, |
| 609 |
<function>ChangePassword()</function>, <function>Lock()</function>, <function>Unlock()</function>, |
| 610 |
<function>Acquire()</function>, <function>Ref()</function>, <function>RefUnrestricted()</function>, |
| 611 |
<function>Release()</function>, |
| 612 |
operate like their matching counterparts on the <classname>org.freedesktop.home1.Manager</classname> |
| 613 |
interface (see above). The main difference is that they are methods of the home directory objects, and |
| 614 |
hence carry no additional user name parameter. Which of the two flavors of methods to call depends on |
| 615 |
the handles to the user known on the client side: if only the user name is known, it is preferable to use |
| 616 |
the methods on the manager object since they operate with user names only. Clients can also easily operate |
| 617 |
on their own home area by using the methods on the manager object with an empty string as the user name. |
| 618 |
If the client has the home's object path already acquired in some way, however, it is preferable to operate |
| 619 |
on the <classname>org.freedesktop.home1.Home</classname> objects instead.</para> |
| 620 |
</refsect2> |
| 621 |
|
| 622 |
<refsect2> |
| 623 |
<title>Properties</title> |
| 624 |
|
| 625 |
<para><varname>UserName</varname> contains the user name of the user account/home directory.</para> |
| 626 |
|
| 627 |
<para><varname>UID</varname> contains the numeric UNIX UID of the user account.</para> |
| 628 |
|
| 629 |
<para><varname>UnixRecord</varname> contains a structure encapsulating the six fields a |
| 630 |
<structname>struct passwd</structname> typically contains (the password field is suppressed).</para> |
| 631 |
|
| 632 |
<para><varname>State</varname> exposes the current state home the home directory.</para> |
| 633 |
|
| 634 |
<para><varname>UserRecord</varname> contains the full JSON user record string of the user account.</para> |
| 635 |
</refsect2> |
| 636 |
</refsect1> |
| 637 |
|
| 638 |
<xi:include href="org.freedesktop.locale1.xml" xpointer="versioning"/> |
| 639 |
|
| 640 |
<refsect1> |
| 641 |
<title>History</title> |
| 642 |
<refsect2> |
| 643 |
<title>The Manager Object</title> |
| 644 |
<para><function>ActivateHomeIfReferenced()</function>, <function>RefHomeUnrestricted()</function>, |
| 645 |
<function>CreateHomeEx()</function>, and <function>UpdateHomeEx()</function> were added in version 256.</para> |
| 646 |
<para><function>AdoptHome()</function>, <function>ListSigningKeys()</function>, |
| 647 |
<function>GetSigningKey()</function>, <function>AddSigningKey()</function>, and |
| 648 |
<function>RemoveSigningKey()</function> were added in version 258.</para> |
| 649 |
</refsect2> |
| 650 |
<refsect2> |
| 651 |
<title>Home Objects</title> |
| 652 |
<para><function>ActivateIfReferenced()</function>, <function>RefUnrestricted()</function>, and |
| 653 |
<function>UpdateEx()</function> were added in version 256.</para> |
| 654 |
</refsect2> |
| 655 |
</refsect1> |
| 656 |
|
| 657 |
<refsect1> |
| 658 |
<title>See Also</title> |
| 659 |
<para><simplelist type="inline"> |
| 660 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 661 |
<member><citerefentry><refentrytitle>systemd-homed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 662 |
<member><citerefentry><refentrytitle>homectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 663 |
</simplelist></para> |
| 664 |
</refsect1> |
| 665 |
|
| 666 |
</refentry> |