This script displays a custom welcome message when users log in, showing:
- Who is connected
- When they connected
- How long they’ve been connected
- Whether they are idle
It replaces the default message of the day (MOTD) with custom information.
Copy the script from GitHub into:
sudo nano /etc/profile.d/active-sessions.shPaste the script, then save and exit.
sudo chmod +x /etc/profile.d/active-sessions.shTo hide the default login message:
sudo chmod -x /etc/update-motd.d/*To re-enable it later if needed:
sudo chmod +x /etc/update-motd.d/*Set your system to the Eastern Time zone:
sudo timedatectl set-timezone America/New_YorkTo edit:
sudo nano /etc/profile.d/active-sessions.shTo delete:
sudo rm /etc/profile.d/active-sessions.sh