Show uptime on shell login

Hi all.


There is something I'm trying to do on my server and that is to show the server uptime when a user logins to his shell account.

I've searched the web for it and I have come this far.

I've edit /etc/csh.login

and putted (uptime) at the bottom of it. And yes it works on root login, but it ain't working on a normal user login. I heard I need to modify the /usr/share/skel/ but I don't really understand how I am going to modify it.

greetings
 
It depends which shell the user uses. /etc/csh.login is for (t)csh users only. Bash or other shell users do not use it. Set it in /etc/profile, most bourne shell related shells read that one.
 
SirDice said:
It depends which shell the user uses.
@OP: If that's not good enough and you want to be absolutely sure that every user sees uptime regardless of which shell they use (which could theoretically even be a custom shell that reads neither /etc/profile nor /etc/csh.login) a roundabout solution might be to set the shell resource in /etc/login.conf to a shell script that does uptime and then execs to the user's actuall login shell, which is in the SHELL environment variable.

Fonz
 
SirDice said:
It depends which shell the user uses. /etc/csh.login is for (t)csh users only. Bash or other shell users do not use it. Set it in /etc/profile, most bourne shell related shells read that one.


Thank you, that is what I was looking for.

And thanks to the rest for the replies.

cheers
 
Back
Top