Skip to content

Latest commit

 

History

History
77 lines (47 loc) · 1.04 KB

File metadata and controls

77 lines (47 loc) · 1.04 KB

Active Sessions Script Setup

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.


1. Copy the Script

Copy the script from GitHub into:

sudo nano /etc/profile.d/active-sessions.sh

Paste the script, then save and exit.


2. Make It Executable

sudo chmod +x /etc/profile.d/active-sessions.sh

3. Disable the Default MOTD

To 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/*

4. Set the Time Zone

Set your system to the Eastern Time zone:

sudo timedatectl set-timezone America/New_York

5. Edit or Remove the Script

To edit:

sudo nano /etc/profile.d/active-sessions.sh

To delete:

sudo rm /etc/profile.d/active-sessions.sh