:~>What is the handiest way to copy user accounts (including homes) to 
:~>another machine?

In case you are transfering from one linux machine to another similar
machine:

PART 1: login to machine 1 (as root)

cd /home
tar -cvzf /tmp/homes.tar.gz *

cd /etc
tar -cvzf /tmp/userdata.tar.gz passwd group shadow 

scp /tmp/homes.tar.gz othermachine:/tmp
scp /tmp/userdata.tar.gz othermachine:/tmp

PART 2: login to machine 2

-unpack the userdata.tgz 
-compare the existing /etc/passwd with the one from the "first" machine
-if you find different users with same UID or GID on both machine, you
will have to change the UID/GID-s. In case you have two users with the
same username, you will obviously have to change this too (and probably
the home directory, too).
Write down what you did. The same with "group" and "shadow". In case you
are ising "NIS" or something similar, you can forget fooling around with
passwd, group & shadow - there are no user data there.

unpack the "homes" tarball in the /home directory of the second machine.
BE CAREFULL: In case you have two users with a same username on both
machines, this might overwrite someones home directory.

if you had to change someones username/UID/GID/homedir, you have to fix
his home-directory:

chown -R user.group /home/user  
chown user.group /home/user/.* 

should do the trick. 

LAST STEP: 

You may have to fix some config-data for your users. For instance,
netscape does not like it if you change the users home directory. Same
with StarOffice. Many more programs will complain if the users login-name
has changed.

hope this helps you

        Denis
-----------------------------------------------------
Mag. Denis Havlik  <http://www.ap.univie.ac.at/users/havlik>
University of Vienna    |||     e-mail: [EMAIL PROTECTED]
Austria                (@ @)       tel: (++431) 4277/51179         
-------------------oOO--(_)--OOo---------------------
Stand up - be counted: http://counter.li.org

Reply via email to