← 返回命令列表

Linux command

pam_motd 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Display message of the day

session optional pam_motd.so

Custom motd location

session optional pam_motd.so motd=/etc/custom_motd

Multiple motd files

session optional pam_motd.so motd_dir=/etc/motd.d

Disable for non-login shells

session optional pam_motd.so noupdate

说明

pam_motd is a PAM module that displays the "message of the day" to users upon login. By default it shows the contents of /etc/motd. It can also run executable scripts in a motd directory (e.g., /etc/update-motd.d/) to generate dynamic messages showing system information, security updates, or custom notices. The module is configured in PAM service files (typically /etc/pam.d/login or /etc/pam.d/sshd) as a session module. It is always marked optional so that login succeeds even if the MOTD cannot be displayed.

参数

motd=_FILE_
MOTD file path.
motd_dir=_DIR_
Directory with MOTD files.
noupdate
Don't run motd scripts.

FAQ

What is the pam_motd command used for?

pam_motd is a PAM module that displays the "message of the day" to users upon login. By default it shows the contents of /etc/motd. It can also run executable scripts in a motd directory (e.g., /etc/update-motd.d/) to generate dynamic messages showing system information, security updates, or custom notices. The module is configured in PAM service files (typically /etc/pam.d/login or /etc/pam.d/sshd) as a session module. It is always marked optional so that login succeeds even if the MOTD cannot be displayed.

How do I run a basic pam_motd example?

Run `session optional pam_motd.so` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does motd=_FILE_ do in pam_motd?

MOTD file path.