Debian Codegraph @

upstream/fedora-44/man8/pam_motd.8

raw
1 '\" t
2 .\" Title: pam_motd
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\" Date: 01/23/2026
6 .\" Manual: Linux-PAM Manual
7 .\" Source: Linux-PAM
8 .\" Language: English
9 .\"
10 .TH "PAM_MOTD" "8" "01/23/2026" "Linux\-PAM" "Linux\-PAM Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 pam_motd \- Display the motd file
32 .SH "SYNOPSIS"
33 .HP \w'\fBpam_motd\&.so\fR\ 'u
34 \fBpam_motd\&.so\fR [motd=\fI/path/filename\fR] [motd_dir=\fI/path/dirname\&.d\fR]
35 .SH "DESCRIPTION"
36 .PP
37 pam_motd is a PAM module that can be used to display arbitrary motd (message of the day) files after a successful login\&. By default, pam_motd shows files in the following locations:
38 .PP
39 .RS 4
40 /etc/motd
41 .RE
42 .RS 4
43 /run/motd
44 .RE
45 .RS 4
46 /usr/lib/motd
47 .RE
48 .RS 4
49 /etc/motd\&.d/
50 .RE
51 .RS 4
52 /run/motd\&.d/
53 .RE
54 .RS 4
55 /usr/lib/motd\&.d/
56 .RE
57 .PP
58 Each message size is limited to 64KB\&.
59 .PP
60 If
61 /etc/motd
62 does not exist, then
63 /run/motd
64 is shown\&. If
65 /run/motd
66 does not exist, then
67 /usr/lib/motd
68 is shown\&.
69 .PP
70 Similar overriding behavior applies to the directories\&. Files in
71 /etc/motd\&.d/
72 override files with the same name in
73 /run/motd\&.d/
74 and
75 /usr/lib/motd\&.d/\&. Files in
76 /run/motd\&.d/
77 override files with the same name in
78 /usr/lib/motd\&.d/\&.
79 .PP
80 Files in the directories listed above are displayed in lexicographic order by name\&. Moreover, the files are filtered by reading them with the credentials of the target user authenticating on the system\&.
81 .PP
82 To silence a message, a symbolic link with target
83 /dev/null
84 may be placed in
85 /etc/motd\&.d
86 with the same filename as the message to be silenced\&. Example: Creating a symbolic link as follows silences
87 /usr/lib/motd\&.d/my_motd\&.
88 .PP
89 \fBln \-s /dev/null /etc/motd\&.d/my_motd\fR
90 .PP
91 The
92 \fBMOTD_SHOWN=pam\fR
93 environment variable is set after showing the motd files, even when all of them were silenced using symbolic links\&.
94 .SH "OPTIONS"
95 .PP
96 motd=/path/filename
97 .RS 4
98 The
99 /path/filename
100 file is displayed as message of the day\&. Multiple paths to try can be specified as a colon\-separated list\&. By default this option is set to
101 /etc/motd:/run/motd:/usr/lib/motd\&.
102 .RE
103 .PP
104 motd_dir=/path/dirname\&.d
105 .RS 4
106 The
107 /path/dirname\&.d
108 directory is scanned and each file contained inside of it is displayed\&. Multiple directories to scan can be specified as a colon\-separated list\&. By default this option is set to
109 /etc/motd\&.d:/run/motd\&.d:/usr/lib/motd\&.d\&.
110 .RE
111 .PP
112 When no options are given, the default behavior applies for both options\&. Specifying either option (or both) will disable the default behavior for both options\&.
113 .SH "MODULE TYPES PROVIDED"
114 .PP
115 Only the
116 \fBsession\fR
117 module type is provided\&.
118 .SH "RETURN VALUES"
119 .PP
120 PAM_ABORT
121 .RS 4
122 Not all relevant data or options could be obtained\&.
123 .RE
124 .PP
125 PAM_BUF_ERR
126 .RS 4
127 Memory buffer error\&.
128 .RE
129 .PP
130 PAM_IGNORE
131 .RS 4
132 This is the default return value of this module\&.
133 .RE
134 .SH "EXAMPLES"
135 .PP
136 The suggested usage for
137 /etc/pam\&.d/login
138 is:
139 .sp
140 .if n \{\
141 .RS 4
142 .\}
143 .nf
144 session optional pam_motd\&.so
145
146 .fi
147 .if n \{\
148 .RE
149 .\}
150 .PP
151 To use a
152 motd
153 file from a different location:
154 .sp
155 .if n \{\
156 .RS 4
157 .\}
158 .nf
159 session optional pam_motd\&.so motd=/elsewhere/motd
160
161 .fi
162 .if n \{\
163 .RE
164 .\}
165 .PP
166 To use a
167 motd
168 file from elsewhere, along with a corresponding
169 \&.d
170 directory:
171 .sp
172 .if n \{\
173 .RS 4
174 .\}
175 .nf
176 session optional pam_motd\&.so motd=/elsewhere/motd motd_dir=/elsewhere/motd\&.d
177
178 .fi
179 .if n \{\
180 .RE
181 .\}
182 .sp
183 .SH "SEE ALSO"
184 .PP
185 \fBmotd\fR(5),
186 \fBpam.conf\fR(5),
187 \fBpam.d\fR(5),
188 \fBpam\fR(8)
189 .SH "AUTHOR"
190 .PP
191 pam_motd was written by Ben Collins <bcollins@debian\&.org>\&.
192 .PP
193 The
194 \fBmotd_dir=\fR
195 option was added by Allison Karlitskaya <allison\&.karlitskaya@redhat\&.com>\&.