{
    "mode": "man",
    "parameter": "pam_motd",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/pam_motd/8/json",
    "generated": "2026-09-16T00:46:18Z",
    "synopsis": "pammotd.so [motd=/path/filename] [motddir=/path/dirname.d]",
    "sections": {
        "NAME": {
            "content": "pammotd - Display the motd file\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pammotd.so [motd=/path/filename] [motddir=/path/dirname.d]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "pammotd is a PAM module that can be used to display arbitrary motd (message of the day)\nfiles after a successful login. By default, pammotd shows files in the following locations:\n\n/etc/motd\n/run/motd\n/usr/lib/motd\n/etc/motd.d/\n/run/motd.d/\n/usr/lib/motd.d/\n\nEach message size is limited to 64KB.\n\nIf /etc/motd does not exist, then /run/motd is shown. If /run/motd does not exist, then\n/usr/lib/motd is shown.\n\nSimilar overriding behavior applies to the directories. Files in /etc/motd.d/ override files\nwith the same name in /run/motd.d/ and /usr/lib/motd.d/. Files in /run/motd.d/ override files\nwith the same name in /usr/lib/motd.d/.\n\nFiles in the directories listed above are displayed in lexicographic order by name. Moreover,\nthe files are filtered by reading them with the credentials of the target user authenticating\non the system.\n\nTo silence a message, a symbolic link with target /dev/null may be placed in /etc/motd.d with\nthe same filename as the message to be silenced. Example: Creating a symbolic link as follows\nsilences /usr/lib/motd.d/mymotd.\n",
            "subsections": [
                {
                    "name": "ln -s /dev/null /etc/motd.d/my_motd",
                    "content": "The MOTDSHOWN=pam environment variable is set after showing the motd files, even when all of\nthem were silenced using symbolic links.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "motd=/path/filename\nThe /path/filename file is displayed as message of the day. Multiple paths to try can be\nspecified as a colon-separated list. By default this option is set to\n/etc/motd:/run/motd:/usr/lib/motd.\n\nmotddir=/path/dirname.d\nThe /path/dirname.d directory is scanned and each file contained inside of it is\ndisplayed. Multiple directories to scan can be specified as a colon-separated list. By\ndefault this option is set to /etc/motd.d:/run/motd.d:/usr/lib/motd.d.\n",
            "subsections": [
                {
                    "name": "noupdate",
                    "content": "Don't run the scripts in /etc/update-motd.d to refresh the motd file.\n\nWhen no options are given, the default behavior applies for both options. Specifying either\noption (or both) will disable the default behavior for both options.\n"
                }
            ]
        },
        "MODULE TYPES PROVIDED": {
            "content": "Only the session module type is provided.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "PAMABORT\nNot all relevant data or options could be obtained.\n\nPAMBUFERR\nMemory buffer error.\n\nPAMIGNORE\nThis is the default return value of this module.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "The suggested usage for /etc/pam.d/login is:\n\nsession  optional  pammotd.so\n\n\nTo use a motd file from a different location:\n\nsession  optional  pammotd.so motd=/elsewhere/motd\n\n\nTo use a motd file from elsewhere, along with a corresponding .d directory:\n\nsession  optional  pammotd.so motd=/elsewhere/motd motddir=/elsewhere/motd.d\n\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "motd(5), pam.conf(5), pam.d(5), pam(7), update-motd(5)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "pammotd was written by Ben Collins <bcollins@debian.org>.\n\nThe motddir= option was added by Allison Karlitskaya <allison.karlitskaya@redhat.com>.\n\nLinux-PAM                                    05/07/2023                                  PAMMOTD(8)",
            "subsections": []
        }
    },
    "summary": "pammotd - Display the motd file",
    "flags": [],
    "examples": [
        "The suggested usage for /etc/pam.d/login is:",
        "session  optional  pammotd.so",
        "To use a motd file from a different location:",
        "session  optional  pammotd.so motd=/elsewhere/motd",
        "To use a motd file from elsewhere, along with a corresponding .d directory:",
        "session  optional  pammotd.so motd=/elsewhere/motd motddir=/elsewhere/motd.d"
    ],
    "see_also": [
        {
            "name": "motd",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/motd/5/json"
        },
        {
            "name": "pam.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pam.conf/5/json"
        },
        {
            "name": "pam.d",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pam.d/5/json"
        },
        {
            "name": "pam",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pam/7/json"
        },
        {
            "name": "update-motd",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/update-motd/5/json"
        }
    ]
}