Suppressing Last Login on HP UX for SUDO command and Specific User

I am attempting to suppress Last Login information being displayed for a specific user when sudo'ing a command.

I have set the attribut "DISPLAY_LAST_LOGIN" to equal 0 for that user in the userdb, however it is still showing the Last Login information.

Our OS is HP UX, realease B.11.31.

root myserver as livehost:/usr/users/myuser/scripts/test $ userdbget -u myuser
myuser DISPLAY_LAST_LOGIN=0

Open in new window


What am I missing?
LVL 1
Terry RogersIT Senior EngineerAsked:
Who is Participating?
 
Terry RogersIT Senior EngineerAuthor Commented:
I've tried this but that didn't work.

I got over this by added an exception for root:-

/usr/sbin/userdbset -u root DISPLAY_LAST_LOGIN=0

Not ideal, but no other option I can see, unless anyone else has a better solution?
0
 
nociSoftware EngineerCommented:
Most probably you need to preserve the environment variable, most environment variables are stripped from the environment by sudo.
you need to check the sudoers file on this setting (or just set the variable there...).
0
 
nociSoftware EngineerCommented:
I have no HP-UX to test with so sorry.  You can close by accepting your own answer as solution if you like.
0
 
Terry RogersIT Senior EngineerAuthor Commented:
Identified solution myself
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.