updating users and groups (was Re: Announcing the release of Fedora 16 Beta!!)

Patrick O'Callaghan pocallaghan at gmail.com
Wed Oct 5 03:02:06 UTC 2011


On Tue, 2011-10-04 at 17:56 -0600, Peter Gueckel wrote:
> I recommend that you manually change the user and group IDs (UID & GID) prior 
> to upgrading the system.
> 
> On the old system:
> 
> usermod -g 1000 username
> usermod -u 1000 username
> 
> Then run:
> 
> chown -R username:username directory
> chgrp -R username:username directory
> 
> for all of your directories.

Don't just do this blindly, especially on large systems with multiple
users. There are two potential problems:

1) You may already have files with user=1000 and/or group=1000. Nothing
in the current Fedora prevents this. Creating a new user.group of
1000.1000 means these files will now belong to user and/or group, which
is probably not what you want.

2) "chown -R ... directory" also assumes that everything in the tree
below "directory" should have the same ownership. This is not a safe
assumption in the general case.

IOW you need to a) check that no 1000.1000 files exist, and b) only
change ownership of files belonging to the (old) values of user and
group. In fact to be really paranoid this should be done twice, once for
user and once for group.

Shell scripts using "find ..." are left as an exercise for the reader.

poc



More information about the users mailing list