How to check password expiration date of particular user?

Hi Guys,

I am new to HP-UX and want to find expiration date of particular user please also note i don't have root access on that server.

for e.g.
i have user abc on my HP box and want to know when its password going to expire and also when its password changed last time.

I also try to locate /etc/shadow file but unable to locate on server.

Thanks in advance for any help !!!

Regards,
Yasin Rakhangi.

1 Like

Hello Yasin Rakhangi,

Welcome to forum, kindly use code tags for commands/codes/Inputs which you are using in your posts.
Could you please use following command and let us know if this helps.

passwd -s "user_name"

Thanks,
R. Singh

-s option will require root, which the OP doesn't have access to.
It will work only for current user which is logged on, will not accept <username> as a parameter with Permission denied.

Also, on default HPUX boxes don't have /etc/shadow. You can install it.

Regards
Peasant.

hi Ravinder/Peasant,

Thanks for your reply.
I have tried suggested options but as commented by peasant it is not working below is the error.

$ passwd -s "user_name"

Password cannot be changed.  Reason: Cannot access protected password entry.

also i have tried without username

$ passwd -s

Password cannot be changed.  Reason: Cannot access protected password entry.

@Peasant,
Yes, I am logged in on system using same user for which i want expiry details.

Is there any other option available to find out?

Regards,
Yasin Rakhangi.

Without root, hardly.

Looks like a HP trusted system at the first glance.

My HP-UX is 11.11 :o and stores files in /tcb/files/auth with the various details you are after. The values are stored in seconds since the Epoch (00:00:00 on 1/1/1970)

The problem you will have is that without superuser access, you are not considered trustworthy enough to know this information.

One wonders why you need to know anyway. Can you enlighten us?

Regards,
Robin

No chance without root permissions.

Why do you want this information?

On a Solaris system using nisplus password administration, the command:

passwd -r nisplus -s

will show you the password aging information for your account.

It appears that HP/UX has a similar feature, but the online HP/UX passwd(1) man page in the Man Pages tab in this forum seems to be mangled, so I can't tell you what options you need to use to get it nor what restrictions apply to unprivileged users accessing that data.

Looking for the -s option in output from the command man 1 passwd on your HP/UX system may help you find what you want.

Robin,
One reason for wanting to know when my password will expire is that some system administrators set up password aging requiring that a password be changed every six months and you may want to check to be sure that your password won't expire while you're out of the office on vacation for a couple of weeks.

It can also be used as a sanity check to see when your password was last changed. If you find that it changed recently and you didn't do it, it is confirmation that your account has been modified by someone (even if they restored your original password so you can still login).

1 Like