Debian Codegraph @

upstream/debian-trixie/man8/pam_systemd_home.8

raw
1 '\" t
2 .TH "PAM_SYSTEMD_HOME" "8" "" "systemd 257.13" "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 don\*(Aqt support the re\-authentication mechanism\&. In that case the TTY sessions will appear hung until the user logs in on another virtual terminal (regardless if 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 "MODULE TYPES PROVIDED"
67 .PP
68 The module implements all four PAM operations:
69 \fBauth\fR
70 (to allow authentication using the encrypted data),
71 \fBaccount\fR
72 (because users with
73 systemd\-homed\&.service
74 user accounts are described in a
75 \m[blue]\fBJSON user record\fR\m[]\&\s-2\u[1]\d\s+2
76 and may be configured in more detail than in the traditional Linux user database),
77 \fBsession\fR
78 (because user sessions must be tracked in order to implement automatic release when the last session of the user is gone),
79 \fBpassword\fR
80 (to change the encryption password \(em also used for user authentication \(em through PAM)\&.
81 .SH "ENVIRONMENT"
82 .PP
83 The following environment variables are initialized by the module and available to the processes of the user\*(Aqs session:
84 .PP
85 \fI$SYSTEMD_HOME=1\fR
86 .RS 4
87 Indicates that the user\*(Aqs home directory is managed by
88 systemd\-homed\&.service\&.
89 .sp
90 Added in version 245\&.
91 .RE
92 .PP
93 \fI$SYSTEMD_HOME_SUSPEND=\fR
94 .RS 4
95 Indicates whether the session has been registered with the suspend mechanism enabled or disabled (see above)\&. The variable\*(Aqs value is either
96 "0"
97 or
98 "1"\&. Note that the module both reads the variable when initializing, and sets it for sessions\&.
99 .sp
100 Added in version 246\&.
101 .RE
102 .SH "EXAMPLE"
103 .PP
104 Here\*(Aqs an example PAM configuration fragment that permits users managed by
105 systemd\-homed\&.service
106 to log in:
107 .sp
108 .if n \{\
109 .RS 4
110 .\}
111 .nf
112 #%PAM\-1\&.0
113 auth sufficient pam_unix\&.so
114 \fB\-auth sufficient pam_systemd_home\&.so\fR
115 auth required pam_deny\&.so
116
117 account required pam_nologin\&.so
118 \fB\-account sufficient pam_systemd_home\&.so\fR
119 account sufficient pam_unix\&.so
120 account required pam_permit\&.so
121
122 \fB\-password sufficient pam_systemd_home\&.so\fR
123 password sufficient pam_unix\&.so sha512 shadow try_first_pass
124 password required pam_deny\&.so
125
126 \-session optional pam_keyinit\&.so revoke
127 \-session optional pam_loginuid\&.so
128 \fB\-session optional pam_systemd_home\&.so\fR
129 \-session optional pam_systemd\&.so
130 session required pam_unix\&.so
131 .fi
132 .if n \{\
133 .RE
134 .\}
135 .SH "SEE ALSO"
136 .PP
137 \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)
138 .SH "NOTES"
139 .IP " 1." 4
140 JSON user record
141 .RS 4
142 \%https://systemd.io/USER_RECORD/
143 .RE