Idea #1 - Customizing agetty
This is just a rough idea but I believe if your system is making use of systemd
then your login prompt is controlled by this service file:
/lib/systemd/system/[email protected]
If you look through this file:
$ grep -i exec /lib/systemd/system/[email protected]
ExecStart=-/sbin/agetty --noclear %I 38400 linux
If you take a look at agetty
's man page it takes variety of switches. Perhaps you could either customize the prompt that agetty
shows or you could swap out agetty
for an alternative that does, or wrap agetty
with a script that would display the time/date.
EDIT #1
Q: I checked agetty man, but there's no info as to displaying time/date in real time.
This wasn't meant as a out of the box solution, it was a rough idea for doing something. In searching for this there isn't really any way to do what you want, easily. You'll have to either create a customized version of agetty
or change to something else like mgetty
or something else entirely.
Idea #2 - /etc/issue file
The only other method I can conceive of doing something like you want with the time/date being displayed would be to make use of the file /etc/issue
. The contents of this file allows for a few macros to be displayed such as these:
excerpt agetty man page
ISSUE ESCAPES
The issue-file (/etc/issue or the file set with the -f option) may
contain certain escape codes to display the system name, date and
time etc. All escape codes consist of a backslash (\) immediately
followed by one of the letters explained below.
d Insert the current date.
s Insert the system name, the name of the operating system.
Same as `uname -s'.
m Insert the architecture identifier of the machine. Same as
`uname -m'.
n Insert the nodename of the machine, also known as the
hostname. Same as `uname -n'.
o Insert the NIS domainname of the machine. Same as
`hostname -d'.
r Insert the release number of the OS. Same as `uname -r'.
t Insert the current time.
Example: On my system, the following /etc/issue file:
This is \n.\o (\s \m \r) \t
displays as
This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30
Here's an example of my ancient /etc/issue
box from a Fedora Core 3 system, when I used to take he time to set things like this up.
The source of that file looks like this:
The penguin was generated using the linux_logo
command, specifically the classic (-c
) version.