Turn the MOTD into a helpful, secure and dynamic login message. 16.11.2025 | reading time: 3 min The Message Of The Day (MOTD) is the first thing users see after login; use it to communicate status, legal notices, or maintenance windows and reduce support noise while improving security awareness. Create a simple static banner Tell, then show: write a basic banner with a single command and verify it; for example, run ```sh sudo sh -c 'echo "Welcome to $(hostname) - Authorized access only." > /etc/motd' cat /etc/motd ``` and the output will display the new text at next interactive login. Make the banner dynamic On Debian/Ubuntu families put an executable script into `/etc/update-motd.d` so the MOTD is generated on each login; example steps in one line: ```sh sudo sh -c 'cat > /etc/update-motd.d/99-local <<"EOF" #!/bin/sh printf "Welcome to %s\n" "$(hostname)" printf "Uptime: %s\n" "$(cut -d. -f1 /proc/uptime) seconds" printf "Authorized use only."\n EOF' sudo chmod +x /etc/update-motd.d/99-local run-parts /etc/update-motd.d ``` which produces a fresh message each time and avoids overwriting distro-managed fragments. Pre-login and PAM considerations Remember the difference between pre-login banners (`/etc/issue` and `/etc/issue.net`) and post-login MOTD (`/etc/motd` or update-motd.d), and enable `pam_motd.so` in the PAM stack if the distribution does not display the generated MOTD automatically. Formatting, security and automation tips Keep messages concise, avoid sensitive data, and prefer scripts that run quickly; use `run-parts` friendly naming (leading numbers for ordering), leverage systemd timers or configuration management for consistency, and sign or verify content in environments that require integrity guarantees. Other relevant tools Tools that interact with the login banner include systemd services for scheduling updates, configuration management for consistency across hosts, and PAM modules for enforcing display behavior; use these to integrate MOTD into a broader operational workflow. Final thought A well-crafted MOTD is low-effort high-impact: it informs users, reduces support tickets and can surface critical status — take the few minutes to script a dynamic message and bake it into your host provisioning; to deepen practical Linux skills consider pursuing certifications such as CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. setup security utilities scripting boot-process