Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Installation - Getting started with Red Hat Linux
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
User sync between 2 servers

User sync between 2 servers

2005-03-22       - By Ed Wilts

 Back
Reply:     1     2  

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.