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

Open in new window

What am I missing?
Terry RogersIT Senior EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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...).
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?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
Terry RogersIT Senior EngineerAuthor Commented:
Identified solution myself
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.