Operating System - HP-UX
1836357 Members
2143 Online
110100 Solutions
New Discussion

Listing Deactivated users on a trusted system

 
Angelo Mercieca
Occasional Contributor

Listing Deactivated users on a trusted system

Hi.
Just a couple of quick questions.

1. Is there a way I can list only deactivated users?

2. Is it possible to tell how long a before a user-id will be automatically deactivated (due to inactivity)?

Thanks greatly.

Regards. Ang.
3 REPLIES 3
Rajeev  Shukla
Honored Contributor

Re: Listing Deactivated users on a trusted system

Yes you could,
1. You can list the deactivated users by writing a script that gets the info of all users and compares if its deactivated or not and if yes buts those users in other file. use /usr/lbin/getprpw to get the information and look at "lockout" value.
2. You can get the exact date when a users password will expire. This is calculated from the last password change and the expiry time set (say 60 days). This can be easily done in C.
Let me know if you need help in writing both the scripts.
Rainer von Bongartz
Honored Contributor

Re: Listing Deactivated users on a trusted system


You can get both infos you want usinh the command

/usr/lbin/getprpw

Regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Lee Tae-kyung
Regular Advisor

Re: Listing Deactivated users on a trusted system

Hi Ang..

My answers
1. #who -T
2. You can do it to add the next line in /etc/profile.
In case of Ksh or sh
TMOUT=60; export TMOUT
(The unit of 60 is a second unit)
In case of csh
set autologout=1
(The unit of 1 is a minute unit)

Good day^^

From Korea
I think I am a specialist in IT Korea^^. I am a programmer and SE and DBA