Welcome message about Linux system


Welcome message about Linux system


Triggered during SSH connection/etc/pam.d/login, run the**motd**Set, will/etc/update-motd.d/Run all the scripts under the directory


(Pluggable Authentication Modules)The verification module can be loaded dynamically

Learning summary of PAM module under Linux

Simply put, in/etc/pam.d/A verification module can be placed under the path, and the required service can be called. The file name of the verification module is the name of the service

Called during SSH login/etc/pam.d/login, where the following part callsMotd.

# Prints the message of the day upon successful login.
# (Replaces the `MOTD_FILE' option in login.defs)
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
session    optional   pam_motd.so motd=/run/motd.dynamic
session    optional   pam_motd.so noupdate

Motd (message of today)

Today’s news section provides various information on the welcome page Path is/etc/update-motd.d/, loginEach script under the path is run once

/etc/update-motd.d# ls
00-header     50-landscape-sysinfo  85-fwupd         90-updates-available       91-release-upgrade      95-hwe-eol      98-fsck-at-reboot
10-help-text  50-motd-news          88-esm-announce  91-contract-ua-esm-status  92-unattended-upgrades  97-overlayroot  98-reboot-required

Modify or add a script to modify welcome message

You can also create one/etc/motdFill in the document with the information you want to display The contents of this file will be displayed at the end of all the above scripts

Individual case

Ubuntu installed on the server purchased by Tencent cloud displays a welcome message when entering, but there is no prompt to update the package Running apt list – upgradable has many packages that can be updated Found after inspection/etc/update-motd.d/Script No. 90 is missing under the path90-updates-available, the update package message appears after you copy from other servers and add runnable permissions

Do not display welcome message

If you don’t want to display any welcome messages, there’s another way to change the script above It is to create a blank in the account directory hushlogin

~: touch .hushlogin


Where does the “n packages can be upgraded” message come from

Show packages to be upgraded on login

Learning summary of PAM module under Linux