The script modifies the configuration of the SSH Daemon.
Only use the script if you know what you are doing...I assume no responsibility for any damage to your setups!
Purpose of the Script:
This script has been developed to enable a dynamic Message of the Day (MotD) on a Debian-based system. The MotD is a message displayed to users upon login, and this script makes it dynamic by configuring PAM (Pluggable Authentication Module) and SSH to display dynamic content.
Tasks of the Script:
- Sets up a log file to record script execution and potential errors.
- Checks if the script is being executed on a specific Debian version (Debian 11/bullseye).
- Verifies the presence of required dependencies (lsb_release, sed, cp, service).
- Ensures that the script is executed with root privileges.
- Modifies PAM configuration files for dynamic MotD (/etc/pam.d/sshd and /etc/pam.d/login).
- Modifies the SSH server configuration file to disable the display of a static MotD (/etc/ssh/sshd_config).
- Restarts the SSH server to apply the changes.
Execute this script with root privileges on a Debian 11 (bullseye) system to enable dynamic MotD. It simplifies the process of enhancing the login experience for system administrators and users on Debian-based systems.
Here you can get the script:
Code: Select all
wget -q https://ngc4594.eu/enable_dynamic_motd.sh -O enable_dynamic_motd.sh