Operating System - HP-UX
1833758 Members
2414 Online
110063 Solutions
New Discussion

How to check the date for the account that has been locked?

 
Ngoh Chean Siung
Super Advisor

How to check the date for the account that has been locked?

Hi,

I hv locked my user account with command 'passwd -l username'. Any command to get the date that the account that has been locked?

regards.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: How to check the date for the account that has been locked?

Hi:

Have a look at 'logins'. See the manpages for 'logins(1M)' for more information.

Regards!

...JRF...
Lee Tae-kyung
Regular Advisor

Re: How to check the date for the account that has been locked?

Hi,

You can just get the last modified date of '/etc/passwd' file doing 'ls -al /etc/passwd'.

I think you can't get the date for each user account.

Have a nice day...^__^

From Seoul in Korea.^^
I think I am a specialist in IT Korea^^. I am a programmer and SE and DBA
Lee Tae-kyung
Regular Advisor

Re: How to check the date for the account that has been locked?

In addition,
#last useraccount | head -1
The above command displays the last login information of the user.
#lastb useraccount | head -1
It displays ths last failed login information of the user.

We can guess the date that the account that has been locked.


^^
I think I am a specialist in IT Korea^^. I am a programmer and SE and DBA
Ngoh Chean Siung
Super Advisor

Re: How to check the date for the account that has been locked?

Hi James,

I try logins -x -l but why the password status still PS for valid password. I already locked the user account. It shld be LK for locked based on man logins under -x portion.

-x Display extended information about selected users. This extended
information includes home directory, login shell and password
aging data, each on its own line. Password information consists
of password status (PS for valid password, LK for locked and NP
for no password) and, if a password is present, date of last
change, required number of days between changes, and number of
days allowed between changes. In the case of non-trusted
systems, the date of last change will be the latest Thursday
since the change.

Any ideas?

regards.
Tom Henning
Trusted Contributor

Re: How to check the date for the account that has been locked?

If you are using a trusted system you might want to look at the man pages for getprpw and modprpw. Although getprpw does not seem to have a field for date for lockout time, it does should you a good deal of other information about the login.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?