Operating System - HP-UX
1830899 Members
3380 Online
110017 Solutions
New Discussion

Re: Script to disable accounts

 
SOLVED
Go to solution
William Pribble
Frequent Advisor

Script to disable accounts

Hi all,
does anyone have a quick script to disable accounts if they have not been used in 1 months time, looking for trusted and non trusted systems.

Thanks
2 REPLIES 2
Tom Maloy
Respected Contributor
Solution

Re: Script to disable accounts

No script, but you can just use "sam", and set the maximum account inactive time to 30 days. For new accounts - under User Accounts, choose Actions, then User Templates, then Create, then General Account Policies. You will have to apply the changes to existing users. After applying the change, the user will not be able to log in if it's been over 30 days since the last login. You will probably want to examine the password policies, as well.

Tom
Carpe diem!
Ralph Grothe
Honored Contributor

Re: Script to disable accounts

Hi,

you can script this yourself very easily.

Just check the wtmp file for how long certain users haven't logged in through the last command (man last).

Then lock those users' account through

passwd -l user_account_name
Madness, thy name is system administration