0

So i need to display the current time, date and number of logged in users in a ubuntu server, i have eddited the banner but i cant run commands on it. Do i need to run a script for this or is there a way to run commands in a text file like the banner one?

Thanks in advance

1 Answers1

1

On my Ubuntu 14.05.5, the "banner", or Message-Of-The-Day (motd) is produced through running a bunch of scripts. You could add yours to this process. Begin by reading man update-motd, which says, in part:

NAME
       update-motd - dynamic MOTD generation

SYNOPSIS
       /etc/update-motd.d/*

DESCRIPTION
       UNIX/Linux system adminstrators often communicate important information
       to console and remote users by maintaining text in the file  /etc/motd,
       which  is  displayed  by  the  pam_motd(8)  module on interactive shell
       logins.

       Traditionally, this file is static text,  typically  installed  by  the
       distribution  and  only  updated on release upgrades, or overwritten by
       the local administrator with pertinent information.

       Ubuntu introduced the update-motd framework, by which  the  motd(5)  is
       dynamically assembled from a collection of scripts at login.
waltinator
  • 37,856