  | |  | User sync between 2 servers | User sync between 2 servers 2005-03-22 - By Ed Wilts
Back On Tue, Mar 22, 2005 at 11:20:31AM -0500, Thom Paine wrote: > Greetings list. > > I have added a second server with 1 samba share that I want to use to > provide to a different group of people at a site I manage. > > Is there a way to sync the users between the two servers easily? Can I > just copy the /etc/passwd file between the two?
You need the passwd and group entries (both shadown and non-shadow) plus the smbpasswd entries.
We've got a pair of scripts (copy-users.sh and paste-users.pl) that automates it for us. copy-user takes a list of users, creates a tarball which we scp over to the target server, and then paste-user extracts it out and does its magic. Once that's done, we rsynch the user's home directory.
I could make this available but it will need some editing since it has custom stuff just for us (it was designed to help us migrate an RHL 6.2 system to RHEL3). If all you want is users, groups, and passwords, and don't carry about merging the groups between the two systems, this stuff should do:
source:
grep ^${arg}: $LIVE/passwd >> $OUT/passwd grep ^${arg}: $LIVE/shadow >> $OUT/shadow grep ^${arg}: $LIVE/group >> $OUT/group grep ^${arg}: $LIVE/gshadow >> $OUT/gshadow grep ^${arg}: $LIVE/smbpasswd >> $OUT/smbpasswd
tar that up and copy it to the target system
target:
append each of those files to the running copies
-- Ed Wilts, RHCE Mounds View, MN, USA mailto:ewilts@(protected) Member #1, Red Hat Community Ambassador Program
-- Taroon-list mailing list Taroon-list@(protected) http://www.redhat.com/mailman/listinfo/taroon-list
Earn $52 per hosting referral at Lunarpages.
|
|
 |