SUMMARY how to globally change the NIS+ passwd file

From: Dave Martini (martini@mrpeabody.llnl.gov)
Date: Mon Jun 28 1999 - 17:27:41 CDT


Hi here was my original question most people said to write a script
to do it and gave examples.

Hi, I want to expire all my NIS+ user accounts in the nispasswd file so that
the user will have to enter a new password the next time they log in.

Can anyone please tell me the command to change all user accounts at the
same
time to expired or am I going to have to change each one individually in the
GUI??

Is expired the way to go if I want them to have to set a new password and
have
to type in their old password?

THanks

Dave Martini
LLNL

How about a simple script to run the passwd -f command. Such as:

foreach username(`awk '{print $1}' /etc/passwd`)
        /usr/bin/passwd -r nisplus -f $username
end

No one command, but this will do the trick.

awk -F ":" '$3 > 100 { print "passwd -f",$1}' /etc/passwd | /bin/sh

OR

for U in awk -F ":" '$3 > 100 {print $1}' /etc/passwd
do
   passwd -f $U
done

Choose a UID high enough to avoid the root, bin, DBA and other users you
don't want to do this to.

Bill

I dont know how proficient you are with scripting, but this is what I would
do.

nidaddent -d shadow > /tmp/nisshadow

That will put the NIS shadow file into a text file named /tmp/nisshadow.
Then, write a script that manually changes the expiration of the passwords
on that file.

Then, when you are done,
nisaddent -mvt shadow /tmp/nisshadow

That will merge the /tmp/nisshadow file back into the NIS+ shadow map.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:23 CDT