PAM_MOTD(8)
๐ pam_motd โ bestie's guide to the message of the day ๐
okay so real talk, this is pam_motd from the Linux-PAM Manual (section 8, system administration girlies rise up ๐
). she's a PAM module and she's literally just here to show you a lil message after you log in. iconic behavior, no cap.
โจ NAME โจ
pam_motd โ display the motd file ๐
โจ SYNOPSIS โจ
pam_motd.so [motd=/path/filename] [motd_dir=/path/dirname.d]
โจ DESCRIPTION โจ
so pam_motd is a PAM module that shows arbitrary motd (message of the day) files after a successful login ๐ซถ. by default she's showing you files from these locations, periodt:
/etc/motd
/run/motd
/usr/lib/motd
/etc/motd.d/
/run/motd.d/
/usr/lib/motd.d/
each message is capped at 64KB โ we love a size limit, it's giving boundaries ๐ .
if /etc/motd doesn't exist, then /run/motd gets shown instead. and if /run/motd doesn't exist either, then it's /usr/lib/motd's time to shine โจ.
same overriding energy applies to the directories, fr fr. files in /etc/motd.d/ override files with the same name in /run/motd.d/ and /usr/lib/motd.d/. and files in /run/motd.d/ override files with the same name in /usr/lib/motd.d/. it's giving hierarchy, it's giving main character energy ๐.
files in the directories listed above get displayed in lexicographic order by name ๐ฆ. and on top of that, the files are filtered by reading them with the credentials of the target user authenticating on the system. very demure, very mindful.
now, to silence a message? you can place a symbolic link with target /dev/null in /etc/motd.d with the same filename as the message you wanna silence. not me ghosting a motd file ๐ญ. example: creating a symbolic link like this silences /usr/lib/motd.d/my_motd.
ln -s /dev/null /etc/motd.d/my_motd
and listen โ the MOTD_SHOWN=pam environment variable is set after showing the motd files, even when all of them were silenced using symbolic links. she always shows up to the function, even when the vibes are quiet ๐ธ.
โจ OPTIONS โจ
motd=/path/filenameโ the/path/filenamefile gets displayed as the message of the day ๐. you can specify multiple paths to try as a colon-separated list. by default this option is set to/etc/motd:/run/motd:/usr/lib/motd.motd_dir=/path/dirname.dโ the/path/dirname.ddirectory gets scanned and every file inside of it gets displayed ๐. multiple directories to scan can be specified as a colon-separated list. by default this option is set to/etc/motd.d:/run/motd.d:/usr/lib/motd.d.
๐จ heads up bestie: when no options are given, the default behavior applies for both options. but specifying either option (or both!) will disable the default behavior for both options. that's the whole plot twist ๐.
โจ MODULE TYPES PROVIDED โจ
only the session module type is provided. just the one. she's specialized ๐.
โจ RETURN VALUES โจ
PAM_ABORTโ not all relevant data or options could be obtained ๐ญ.PAM_BUF_ERRโ memory buffer error ๐.PAM_IGNOREโ this is the default return value of this module โจ.
โจ EXAMPLES โจ
the suggested usage for /etc/pam.d/login is:
session optional pam_motd.so
to use a motd file from a different location:
session optional pam_motd.so motd=/elsewhere/motd
to use a motd file from elsewhere, along with a corresponding .d directory:
session optional pam_motd.so motd=/elsewhere/motd motd_dir=/elsewhere/motd.d
โจ SEE ALSO โจ
motd(5), pam.conf(5), pam.d(5), pam(8) โ go read those too, iykyk ๐
โจ AUTHOR โจ
pam_motd was written by Ben Collins <bcollins@debian.org> ๐.
the motd_dir= option was added by Allison Karlitskaya <allison.karlitskaya@redhat.com> ๐.
and that's the whole page bestie!! ๐ this was Linux-PAM, dated 09/27/2026 โ slay, ate, left no crumbs, and logged you in with a cute lil message on the way ๐ โจ๐ฆ
๐ฆ where this page comes from
- arch rolling: pam 1.7.3-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms