docs: hook up the new USER_NAMES document everywhere

(Also correct the set of names we accept in User=, which was forgotten
to be updated in ae480f0b09.
This commit is contained in:
Lennart Poettering 2020-04-07 11:04:59 +02:00
parent cafed7b32c
commit 887a8fa341
4 changed files with 18 additions and 8 deletions

View File

@ -205,7 +205,8 @@ object. The following fields are currently defined:
UNIX user name. This field is the only mandatory field, all others are UNIX user name. This field is the only mandatory field, all others are
optional. Corresponds with the `pw_name` field of of `struct passwd` and the optional. Corresponds with the `pw_name` field of of `struct passwd` and the
`sp_namp` field of `struct spwd` (i.e. the shadow user record stored in `sp_namp` field of `struct spwd` (i.e. the shadow user record stored in
`/etc/shadow`). `/etc/shadow`). See [User/Group Name Syntax](https://systemd.io/USER_NAMES) for
the (relaxed) rules the various systemd components enforce on user/group names.
`realm` → The "realm" a user is defined in. This concept allows distinguishing `realm` → The "realm" a user is defined in. This concept allows distinguishing
users with the same name that originate in different organizations or users with the same name that originate in different organizations or

View File

@ -677,7 +677,10 @@
<listitem><para>Create a new home directory/user account of the specified name. Use the various <listitem><para>Create a new home directory/user account of the specified name. Use the various
user record property options (as documented above) to control various aspects of the home directory user record property options (as documented above) to control various aspects of the home directory
and its user accounts.</para></listitem> and its user accounts.</para>
<para>The specified user name should follow the strict syntax described on <ulink
url="https://systemd.io/USER_NAMES">User/Group Name Syntax</ulink>.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -217,12 +217,15 @@
is set, the default group of the user is used. This setting does not affect commands whose command line is is set, the default group of the user is used. This setting does not affect commands whose command line is
prefixed with <literal>+</literal>.</para> prefixed with <literal>+</literal>.</para>
<para>Note that restrictions on the user/group name syntax are enforced: the specified name must consist only <para>Note that this enforces only weak restrictions on the user/group name syntax, but will generate
of the characters a-z, A-Z, 0-9, <literal>_</literal> and <literal>-</literal>, except for the first character warnings in many cases where user/group names do not adhere to the following rules: the specified
which must be one of a-z, A-Z or <literal>_</literal> (i.e. numbers and <literal>-</literal> are not permitted name should consist only of the characters a-z, A-Z, 0-9, <literal>_</literal> and
as first character). The user/group name must have at least one character, and at most 31. These restrictions <literal>-</literal>, except for the first character which must be one of a-z, A-Z and
are enforced in order to avoid ambiguities and to ensure user/group names and unit files remain portable among <literal>_</literal> (i.e. digits and <literal>-</literal> are not permitted as first character). The
Linux systems.</para> user/group name must have at least one character, and at most 31. These restrictions are made in
order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux
systems. For further details on the names accepted and the names warned about see <ulink
url="https://systemd.io/USER_NAMES">User/Group Name Syntax</ulink>.</para>
<para>When used in conjunction with <varname>DynamicUser=</varname> the user/group name specified is <para>When used in conjunction with <varname>DynamicUser=</varname> the user/group name specified is
dynamically allocated at the time the service is started, and released at the time the service is dynamically allocated at the time the service is started, and released at the time the service is

View File

@ -154,6 +154,9 @@ r - 500-900
A-Z or <literal>_</literal> (i.e. numbers and <literal>-</literal> are not permitted as first character). The A-Z or <literal>_</literal> (i.e. numbers and <literal>-</literal> are not permitted as first character). The
user/group name must have at least one character, and at most 31.</para> user/group name must have at least one character, and at most 31.</para>
<para>For further details about the syntax of user/group names, see <ulink
url="https://systemd.io/USER_NAMES">User/Group Name Syntax</ulink>.</para>
<para>It is strongly recommended to pick user and group names that are unlikely to clash with normal users <para>It is strongly recommended to pick user and group names that are unlikely to clash with normal users
created by the administrator. A good scheme to guarantee this is by prefixing all system and group names with the created by the administrator. A good scheme to guarantee this is by prefixing all system and group names with the
underscore, and avoiding too generic names.</para> underscore, and avoiding too generic names.</para>