Creating user accounts....

Steve Cousins cousins at limpet.umeoce.maine.edu
Thu Feb 20 14:34:15 EST 2003



"RANGI, JAI" <JAI_RANGI at SDSTATE.EDU> wrote:
> 
> Thanks for all of you for giving me the ideas for setting up a script for
> user accounts managements...
> Here is what I did and at this point of time it is working just fine ( Might
> not be very fancy for some of you) for our cluster......
> I created a script for password change like this
> 
> passwd $1
> matchusers.sh 
> 
> This will prompt for the new password and will update all the nodes....
> matchusers.sh script looks like this
> 
> rcp /etc/group geonode1:/etc/group
> rcp /etc/passwd geonode1:/etc/passwd
> rcp /etc/shadow geonode1:/etc/shadow
> rcp /etc/group geonode2:/etc/group
> rcp /etc/passwd geonode2:/etc/passwd
> rcp /etc/shadow geonode2:/etc/shadow
> rcp /etc/group geonode3:/etc/group
> rcp /etc/passwd geonode3:/etc/passwd
> rcp /etc/shadow geonode3:/etc/shadow
> .
> .
> .
> for all the nodes in cluster,
> Now if the password is changed for any user it being automatically updated
> on all the nodes.



The person who set up our cluster used rdist and an hourly cron job.  In
the /etc/cron.hourly directory is a file called passwdupdate which
contains:

#!/bin/sh
/usr/bin/rdist -f /etc/distfile > /dev/null

Then in /etc/distfile:

(/etc/passwd) -> root at node2 install /etc/passwd;
(/etc/shadow) -> root at node2 install /etc/shadow;
(/etc/gshadow) -> root at node2 install /etc/gshadow;
(/etc/group) -> root at node2 install /etc/group;

(/etc/passwd) -> root at node3 install /etc/passwd;
(/etc/shadow) -> root at node3 install /etc/shadow;
(/etc/gshadow) -> root at node3 install /etc/gshadow;
(/etc/group) -> root at node3 install /etc/group;
.
.
.

This takes out the risk of corrupting the files (as Donald pointed out).  
You could just run your matchusers.sh script in a cron job but AFAIK rdist
only sends the file if it has changed.

Steve
_____________________________________________________________
 Steve Cousins                 Email: cousins at umit.maine.edu
 Research Associate            Phone: (207) 581-4302
 Ocean Modeling Group
 School of Marine Sciences     208 Libby Hall
 University of Maine           Orono, Maine 04469

_______________________________________________
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf



More information about the Beowulf mailing list