Debian Codegraph @

upstream/debian-unstable/man8/pam_systemd_home.8

raw
1 '\" t
2 .TH "PAM_SYSTEMD_HOME" "8" "" "systemd 261~rc3" "pam_systemd_home"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 pam_systemd_home \- Authenticate users and mount home directories via systemd\-homed\&.service
24 .SH "SYNOPSIS"
25 .PP
26 pam_systemd_home\&.so
27 .SH "DESCRIPTION"
28 .PP
29 \fBpam_systemd_home\fR
30 ensures that home directories managed by
31 \fBsystemd-homed.service\fR(8)
32 are automatically activated (mounted) on user login, and are deactivated (unmounted) when the last session of the user ends\&. For such users, it also provides authentication (when per\-user disk encryption is used, the disk encryption key is derived from the authentication credential supplied at login time), account management (the
33 \m[blue]\fBJSON user record\fR\m[]\&\s-2\u[1]\d\s+2
34 embedded in the home store contains account details), and implements the updating of the encryption password (which is also used for user authentication)\&.
35 .SH "OPTIONS"
36 .PP
37 The following options are understood:
38 .PP
39 \fIsuspend=\fR
40 .RS 4
41 Takes a boolean argument\&. If true, the home directory of the user will be suspended automatically during system suspend; if false it will remain active\&. Automatic suspending of the home directory improves security substantially as secret key material is automatically removed from memory before the system is put to sleep and must be re\-acquired (through user re\-authentication) when coming back from suspend\&. It is recommended to set this parameter for all PAM applications that have support for automatically re\-authenticating via PAM on system resume\&. If multiple sessions of the same user are open in parallel the user\*(Aqs home directory will be left unsuspended on system suspend as long as at least one of the sessions does not set this parameter to on\&. Defaults to off\&.
42 .sp
43 Note that TTY logins generally do not support re\-authentication on system resume\&. Re\-authentication on system resume is primarily a concept implementable in graphical environments, in the form of lock screens brought up automatically when the system goes to sleep\&. This means that if a user concurrently uses graphical login sessions that implement the required re\-authentication mechanism and console logins that do not, the home directory is not locked during suspend, due to the logic explained above\&. That said, it is possible to set this field for TTY logins too, ignoring the fact that TTY logins actually do not support the re\-authentication mechanism\&. In that case the TTY sessions will appear hung until the user logs in on another virtual terminal (regardless of whether via another TTY session or graphically) which will resume the home directory and unblock the original TTY session\&. (Do note that lack of screen locking on TTY sessions means even though the TTY session appears hung, keypresses can still be queued into it, and the existing screen contents be read without re\-authentication; this limitation is unrelated to the home directory management
44 \fBpam_systemd_home\fR
45 and
46 systemd\-homed\&.service
47 implement\&.)
48 .sp
49 Turning this option on by default is highly recommended for all sessions, but only if the service managing these sessions correctly implements the aforementioned re\-authentication\&. Note that the re\-authentication must take place from a component running outside of the user\*(Aqs context, so that it does not require access to the user\*(Aqs home directory for operation\&. Traditionally, most desktop environments do not implement screen locking this way, and need to be updated accordingly\&.
50 .sp
51 This setting may also be controlled via the
52 \fI$SYSTEMD_HOME_SUSPEND\fR
53 environment variable (see below), which
54 \fBpam_systemd_home\fR
55 reads during initialization and sets for sessions\&. If both the environment variable is set and the module parameter specified the latter takes precedence\&.
56 .sp
57 Added in version 245\&.
58 .RE
59 .PP
60 \fIdebug\fR[=]
61 .RS 4
62 Takes an optional boolean argument\&. If yes or without the argument, the module will log debugging information as it operates\&.
63 .sp
64 Added in version 245\&.
65 .RE
66 .SH "HOME AREA SUPPORT"
67 .PP
68 Home directories managed by
69 \fBsystemd-homed.service\fR(8)
70 support multiple home "areas", which are additional secondary home directories of the user within the primary home directory\&. An example: at login time if a user
71 "lennart"
72 with a home directory of
73 /home/lennart
74 specifies
75 "lennart%versuch1"
76 as account name during login, then
77 \fBpam_systemd_home\fR
78 will execute a login into
79 "lennart"
80 but ensure that the
81 \fI$HOME\fR
82 variable is set to
83 /home/lennart/Areas/versuch1
84 instead of the usual
85 /home/lennart\&.
86 .PP
87 This is particularly useful when sharing the same home directory between multiple systems (for example between a host and a VM), with the desire to share the home directory to a large degree, but still have separate session configuration in place\&.
88 .PP
89 Note that the default area to log into can also be encoded in the user record, and it can be specified among
90 \fBpam_systemd\fR(8)
91 configuration parameters\&. However, an explicit area specified at login time (via the
92 "%"
93 described above) overrides any such default\&. Also note that simply suffixing an account with
94 "%"
95 at login time (i\&.e\&. specifying an empty area name) has the effect of ensuring a login into the primary home directory, overriding any default area configuration via the user record or PAM\&.
96 .PP
97 Note that not all login mechanisms are compatible with the
98 "%"
99 syntax at login time\&. Most notably
100 \fBssh\fR(8)
101 is not\&.
102 .PP
103 Note that the area directory to log into must exist for the area specification to be respected\&. If an area is specified during login via the
104 "%"
105 logic (or the other mentioned mechanisms) and it does not actually exist the request will be ignored, and the user will log into the primary home directory instead\&.
106 .PP
107 Typically, in order to make use of the mechanism set up an area first, like this:
108 .sp
109 .if n \{\
110 .RS 4
111 .\}
112 .nf
113 lennart@zeta$ mkdir \-p ~/Areas
114 lennart@zeta$ cp \-av /etc/skel ~/Areas/versuch1
115 .fi
116 .if n \{\
117 .RE
118 .\}
119 .PP
120 This should be enough to log into the newly created area, either via a regular terminal (using
121 "lennart%versuch1"
122 when prompted for a user name), or via
123 \fBrun0\fR(1):
124 .sp
125 .if n \{\
126 .RS 4
127 .\}
128 .nf
129 lennart@zeta$ run0 \-\-area=versuch1
130 .fi
131 .if n \{\
132 .RE
133 .\}
134 .SH "MODULE TYPES PROVIDED"
135 .PP
136 The module implements all four PAM operations:
137 \fBauth\fR
138 (to allow authentication using the encrypted data),
139 \fBaccount\fR
140 (because users with
141 systemd\-homed\&.service
142 user accounts are described in a
143 \m[blue]\fBJSON user record\fR\m[]\&\s-2\u[1]\d\s+2
144 and may be configured in more detail than in the traditional Linux user database),
145 \fBsession\fR
146 (because user sessions must be tracked in order to implement automatic release when the last session of the user is gone),
147 \fBpassword\fR
148 (to change the encryption password \(em also used for user authentication \(em through PAM)\&.
149 .SH "ENVIRONMENT"
150 .PP
151 The following environment variables are initialized by the module and available to the processes of the user\*(Aqs session:
152 .PP
153 \fI$SYSTEMD_HOME=1\fR
154 .RS 4
155 Indicates that the user\*(Aqs home directory is managed by
156 systemd\-homed\&.service\&.
157 .sp
158 Added in version 245\&.
159 .RE
160 .PP
161 \fI$SYSTEMD_HOME_SUSPEND=\fR
162 .RS 4
163 Indicates whether the session has been registered with the suspend mechanism enabled or disabled (see above)\&. The variable\*(Aqs value is either
164 "0"
165 or
166 "1"\&. Note that the module both reads the variable when initializing, and sets it for sessions\&.
167 .sp
168 Added in version 246\&.
169 .RE
170 .SH "EXAMPLE"
171 .PP
172 Here\*(Aqs an example PAM configuration fragment that permits users managed by
173 systemd\-homed\&.service
174 to log in:
175 .sp
176 .if n \{\
177 .RS 4
178 .\}
179 .nf
180 #%PAM\-1\&.0
181 \fB\-auth [success=done authtok_err=bad perm_denied=bad maxtries=bad default=ignore] pam_systemd_home\&.so\fR
182 auth sufficient pam_unix\&.so
183 auth required pam_deny\&.so
184
185 account required pam_nologin\&.so
186 \fB\-account [success=done authtok_expired=bad new_authtok_reqd=bad maxtries=bad acct_expired=bad default=ignore] pam_systemd_home\&.so\fR
187 account required pam_unix\&.so
188
189 \fB\-password sufficient pam_systemd_home\&.so\fR
190 password sufficient pam_unix\&.so sha512 shadow try_first_pass
191 password required pam_deny\&.so
192
193 \-session optional pam_keyinit\&.so revoke
194 \-session optional pam_loginuid\&.so
195 \fB\-session optional pam_systemd_home\&.so\fR
196 \-session optional pam_systemd\&.so
197 session required pam_unix\&.so
198 .fi
199 .if n \{\
200 .RE
201 .\}
202 .SH "SEE ALSO"
203 .PP
204 \fBsystemd\fR(1), \fBsystemd-homed.service\fR(8), \fBhomed.conf\fR(5), \fBhomectl\fR(1), \fBpam_systemd\fR(8), \fBpam.conf\fR(5), \fBpam.d\fR(5), \fBpam\fR(8)
205 .SH "NOTES"
206 .IP " 1." 4
207 JSON user record
208 .RS 4
209 \%https://systemd.io/USER_RECORD/
210 .RE