Operating System - HP-UX
1833511 Members
2715 Online
110061 Solutions
New Discussion

Displaying login info on the console

 
SOLVED
Go to solution
Ian Warner
Trusted Contributor

Displaying login info on the console

How do I display log-in information on the console as a matter of routine?
I am running 11.0
Why did anyone invent unix?
6 REPLIES 6
Robert-Jan Goossens
Honored Contributor
Solution

Re: Displaying login info on the console

Hi Ian,

You mean something like this,

How do I enable and/or customize a login banner message for the console

http://www4.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062922869

Hope it helps,

Robert-Jan.
twang
Honored Contributor

Re: Displaying login info on the console

Run a cron job, entry as follows:
00,20,40 * * * * who -u > /dev/console
Ian Warner
Trusted Contributor

Re: Displaying login info on the console

Could you please explain what the cron job doed?

Thanks

Ian
Why did anyone invent unix?
Stefan Farrelly
Honored Contributor

Re: Displaying login info on the console

The cron job runs the who -u command which is a list of all logged on users and sends the output to the console - every 20 mins.

eg, who -u shows;

ops_sf pts/1 Sep 24 08:28 . 26249 orion.ipc.co.uk
Im from Palmerston North, New Zealand, but somehow ended up in London...
Mark Grant
Honored Contributor

Re: Displaying login info on the console

If want a real time login in and log out notification sent to a particular screen you could add something to /etc/profile and possibly Xsession that does "echo $LOGNAME logged in >> /dev/console" and at the end of the file "echo $LOGNAME logged out >> /dev/console". The only problem here is that you will have to give all users rigts to write to /dev/console thath might not be a good idea. So an alternative would be to write that information to a file in /tmp and have a "tail -f" of that file running on the console.
Never preceed any demonstration with anything more predictive than "watch this"
Jakes Louw
Trusted Contributor

Re: Displaying login info on the console

Alternatively, if you just want to be sure which server you're logging into, have a look at /etc/issue and /etc/copyright, which can be modified for your use.
Just bear in mind that these frequently get overwritten during upgrades....
Trying is the first step to failure - Homer Simpson