| 1 |
'\" t |
| 2 |
.\" Title: pam_motd |
| 3 |
.\" Author: [see the "AUTHOR" section] |
| 4 |
.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/> |
| 5 |
.\" Date: 06/29/2025 |
| 6 |
.\" Manual: Linux-PAM Manual |
| 7 |
.\" Source: Linux-PAM |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "PAM_MOTD" "8" "06/29/2025" "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 |
\fBnoupdate\fR |
| 113 |
.RS 4 |
| 114 |
Don\*(Aqt run the scripts in |
| 115 |
/etc/update\-motd\&.d |
| 116 |
to refresh the motd file\&. |
| 117 |
.RE |
| 118 |
.PP |
| 119 |
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\&. |
| 120 |
.SH "MODULE TYPES PROVIDED" |
| 121 |
.PP |
| 122 |
Only the |
| 123 |
\fBsession\fR |
| 124 |
module type is provided\&. |
| 125 |
.SH "RETURN VALUES" |
| 126 |
.PP |
| 127 |
PAM_ABORT |
| 128 |
.RS 4 |
| 129 |
Not all relevant data or options could be obtained\&. |
| 130 |
.RE |
| 131 |
.PP |
| 132 |
PAM_BUF_ERR |
| 133 |
.RS 4 |
| 134 |
Memory buffer error\&. |
| 135 |
.RE |
| 136 |
.PP |
| 137 |
PAM_IGNORE |
| 138 |
.RS 4 |
| 139 |
This is the default return value of this module\&. |
| 140 |
.RE |
| 141 |
.SH "EXAMPLES" |
| 142 |
.PP |
| 143 |
The suggested usage for |
| 144 |
/etc/pam\&.d/login |
| 145 |
is: |
| 146 |
.sp |
| 147 |
.if n \{\ |
| 148 |
.RS 4 |
| 149 |
.\} |
| 150 |
.nf |
| 151 |
session optional pam_motd\&.so |
| 152 |
|
| 153 |
.fi |
| 154 |
.if n \{\ |
| 155 |
.RE |
| 156 |
.\} |
| 157 |
.PP |
| 158 |
To use a |
| 159 |
motd |
| 160 |
file from a different location: |
| 161 |
.sp |
| 162 |
.if n \{\ |
| 163 |
.RS 4 |
| 164 |
.\} |
| 165 |
.nf |
| 166 |
session optional pam_motd\&.so motd=/elsewhere/motd |
| 167 |
|
| 168 |
.fi |
| 169 |
.if n \{\ |
| 170 |
.RE |
| 171 |
.\} |
| 172 |
.PP |
| 173 |
To use a |
| 174 |
motd |
| 175 |
file from elsewhere, along with a corresponding |
| 176 |
\&.d |
| 177 |
directory: |
| 178 |
.sp |
| 179 |
.if n \{\ |
| 180 |
.RS 4 |
| 181 |
.\} |
| 182 |
.nf |
| 183 |
session optional pam_motd\&.so motd=/elsewhere/motd motd_dir=/elsewhere/motd\&.d |
| 184 |
|
| 185 |
.fi |
| 186 |
.if n \{\ |
| 187 |
.RE |
| 188 |
.\} |
| 189 |
.sp |
| 190 |
.SH "SEE ALSO" |
| 191 |
.PP |
| 192 |
\fBmotd\fR(5), |
| 193 |
\fBpam.conf\fR(5), |
| 194 |
\fBpam.d\fR(5), |
| 195 |
\fBpam\fR(7) |
| 196 |
.SH "AUTHOR" |
| 197 |
.PP |
| 198 |
pam_motd was written by Ben Collins <bcollins@debian\&.org>\&. |
| 199 |
.PP |
| 200 |
The |
| 201 |
\fBmotd_dir=\fR |
| 202 |
option was added by Allison Karlitskaya <allison\&.karlitskaya@redhat\&.com>\&. |