Information
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:
/etc/motd
/run/motd
/usr/lib/motd
/etc/motd.d/
/run/motd.d/
/usr/lib/motd.d/
If the pam_motd file does not have the correct access configured, it could be modified by unauthorized users with incorrect or misleading information.
Solution
Run the following commands to set mode, owner, and group to the pam_motd file:
# chown root:root </path/to/motd/>
# chmod u-x,go-wx </path/to/motd/>
Note: The audit procedure command grep -hPo 'motd=\K\S+' /etc/pam.d/* output will provide the path to the pam_motd file.
Example
# chown root:root /run/motd.dynamic
# chmod u-x,go-wx /run/motd.dynamic