1834835 Members
2649 Online
110070 Solutions
New Discussion

mass password reset?

 
Tom Burba
Occasional Advisor

mass password reset?

What's the best way to reset hundreds of passwords -- is there a utility? Tx
UNIX is like an ocean... (anonymous)
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: mass password reset?

Hi Tom:

Create a file of the user names you want to inactivate. Give a file of names titled "tmp/userlist" do:

#!/usr/bin/sh
while read USER
do
passwd -f $USER
done < /tmp/userlist

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: mass password reset?

I would do it something like this:

cat /etc/passwd | awk -F: '{if ($3 >= 101) print $1}' | while read X
do
passwd -f $X
done

This will force each uid >= 101 to enter a new passwd on the next login.

NOTE: Before doing anything make sure you make a safe copy of the passwd file and be logged in as root in at least two sessions. That way you can get ypurself out of trouble just as fast as you got yourself in.

Regards, Clay
If it ain't broke, I can fix that.
Michael Tully
Honored Contributor

Re: mass password reset?

Hi,

James and Clay are right as usual, but there is a utility if you have a trusted system, and that is:

# /usr/lbin/modprpw -E
This utility will go through the protected password database and remove all of the successful login times from all users. The result is all users will need to enter a new password at the next login.
Make sure you have a copy of all files under /tcb as well as /etc/passwd

Regards
Michael
Anyone for a Mutiny ?