1PAM_MOTD(8)                    Linux-PAM Manual                    PAM_MOTD(8)
2
3
4

NAME

6       pam_motd - Display the motd file
7

SYNOPSIS

9       pam_motd.so [motd=/path/filename] [motd_dir=/path/dirname.d]
10

DESCRIPTION

12       pam_motd is a PAM module that can be used to display arbitrary motd
13       (message of the day) files after a successful login. By default,
14       pam_motd shows files in the following locations:
15
16           /etc/motd
17           /run/motd
18           /usr/lib/motd
19           /etc/motd.d/
20           /run/motd.d/
21           /usr/lib/motd.d/
22
23       Each message size is limited to 64KB.
24
25       If /etc/motd does not exist, then /run/motd is shown. If /run/motd does
26       not exist, then /usr/lib/motd is shown.
27
28       Similar overriding behavior applies to the directories. Files in
29       /etc/motd.d/ override files with the same name in /run/motd.d/ and
30       /usr/lib/motd.d/. Files in /run/motd.d/ override files with the same
31       name in /usr/lib/motd.d/.
32
33       Files in the directories listed above are displayed in lexicographic
34       order by name. Moreover, the files are filtered by reading them with
35       the credentials of the target user authenticating on the system.
36
37       To silence a message, a symbolic link with target /dev/null may be
38       placed in /etc/motd.d with the same filename as the message to be
39       silenced. Example: Creating a symbolic link as follows silences
40       /usr/lib/motd.d/my_motd.
41
42       ln -s /dev/null /etc/motd.d/my_motd
43
44       The MOTD_SHOWN=pam environment variable is set after showing the motd
45       files, even when all of them were silenced using symbolic links.
46

OPTIONS

48       motd=/path/filename
49           The /path/filename file is displayed as message of the day.
50           Multiple paths to try can be specified as a colon-separated list.
51           By default this option is set to /etc/motd:/run/motd:/usr/lib/motd.
52
53       motd_dir=/path/dirname.d
54           The /path/dirname.d directory is scanned and each file contained
55           inside of it is displayed. Multiple directories to scan can be
56           specified as a colon-separated list. By default this option is set
57           to /etc/motd.d:/run/motd.d:/usr/lib/motd.d.
58
59       When no options are given, the default behavior applies for both
60       options. Specifying either option (or both) will disable the default
61       behavior for both options.
62

MODULE TYPES PROVIDED

64       Only the session module type is provided.
65

RETURN VALUES

67       PAM_ABORT
68           Not all relevant data or options could be obtained.
69
70       PAM_BUF_ERR
71           Memory buffer error.
72
73       PAM_IGNORE
74           This is the default return value of this module.
75

EXAMPLES

77       The suggested usage for /etc/pam.d/login is:
78
79           session  optional  pam_motd.so
80
81
82       To use a motd file from a different location:
83
84           session  optional  pam_motd.so motd=/elsewhere/motd
85
86
87       To use a motd file from elsewhere, along with a corresponding .d
88       directory:
89
90           session  optional  pam_motd.so motd=/elsewhere/motd motd_dir=/elsewhere/motd.d
91
92
93

SEE ALSO

95       motd(5), pam.conf(5), pam.d(5), pam(8)
96

AUTHOR

98       pam_motd was written by Ben Collins <bcollins@debian.org>.
99
100       The motd_dir= option was added by Allison Karlitskaya
101       <allison.karlitskaya@redhat.com>.
102
103
104
105Linux-PAM Manual                  12/04/2020                       PAM_MOTD(8)
Impressum