Eric H. Johnson on 7 May 2013 12:40:56 -0700

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

Re: [PLUG] Moving user accounts


The only account that overlaps is the administrator account and I do not
need to move it. The new computer is a fresh install with no user accounts
other than the defaults.


If your IDs/usernames/groupnames do not overlap (unlikely with how most
distros manage these), then you can do exactly that and there are no issues
(assuming you don't want to merge any accounts).  Those files are just text
files - you can merge them like any text file, and cp -a or otherwise copy
the filesystems (preserving all metadata).

If they do overlap, then you need to renumber the IDs and rename the names.
I'd look for a UID/GID-renumbering utility - I'm sure there are some out
there.  Usually you'll want to do this when nobody affected is using the
system.  Once you've renumbered one of the two systems, then they can be
merged.  Renaming accounts is easy - just rename the home directories and
edit passwd/shadow.  Changing the IDs requires finding all files owned by
those IDs and chowning them to the new ID.

If you do have common accounts across the systems, then map them to the same
UID, and delete the duplicate passwd/shadow entries.  I probably wouldn't
just merge the home directories though - you'll run into a million conflicts
- I'd stick one directory in a subdir of the other or something.

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --