[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SOLVED] Re: Moving users



Alvin Oga wrote:

On Mon, 22 Nov 2004, nx13372a wrote:

Hi,

I have .tgz(s) with the content of /etc and another with /home from a box.
If i untar the /home in a new box and copy the /etc/passwd and /etc/shadow, is this enough for my users can login?

no, you would be making the classic mistake .. dont do that part having
to do with passwd and shadow

# check it .... that it only has home/* in it
cd / ; tar ztvf home.tgz | grep home/*

cd / ; tar zxvfp home.tgz

#
# put all your userID and passwd in a temp location
#
cd /home ; mkdir old-pwd-shadow

cd old-pwd-shadow

tar zxvfp old-etc.tgz
vi old-pwd-shadow/etc/passwd ....
	- remove all the system passwd entries

	- all users should be id's after 100 or 500 or 1,000 or
	whatever you used for userID

=
= do NOT copy system id's to the new box .. strange things will happen
=

vi old-pwd-shadow/etc/shadow ...
	- remove all the system passwd entries


now you are ready to put your users into your new box

cp -p /etc/shadow /etc/shadow.original
cp -p /etc/passwd /etc/passwd.original

cat old-wpd-shadow/etc/shadow >> /etc/shadow
cat old-wpd-shadow/etc/passwd >> /etc/passwd

== look for any duplicate usernames and userIDs and groupIDs
	- remove the old ones .. use the new one in the new system

c ya
alvin


Many thanks Alvin Oga



Reply to: