I would like to find the simplest way to remove the old system admin's user and group from a Gentoo server and put them all under my name instead. He no longer works here and it would appear that a large number of applications (apache, tomcat, django, etc) are currently running with his user and group, so I do not want to risk interrupting any of them until I have time to go through each one and tinker.
Ideally, all files with his user and/or group would be reassigned to my existing user. If you have any ideas about how to accomplish this, then you do not need to read on, I'm simply brainstorming alternate solutions since I have been unsuccessful at merging the two accounts so far.
Less ideally, I could rename his user and group to be something like "admin" or a new account for myself, change the password, and put the new user "admin" in all of the secondary groups that the old user was in.
usermod -l oldname admin
usermod -g oldname admin
Etc.
I have a feeling that since the user and group uid would stay the same with a name change that I would not need to change ownership / groups on all of the files that he owns? If I did, then this is the command I've thought up (I haven't tested it yet, I don't think it would work as it is but I would get it working eventually):
sudo find / -user oldName -exec sudo chown admin:admin \;
What would you recommend that I do? I think my problem is slightly uncommon because I can't just remove the old user and his home directory since I have to try to untangle the web of hundreds of thousands of files running with his permissions, and I have been unable to find an answer through googling. Any advice you can give me would be appreciated!
/etc
directory,emerge -ca package owned by oldadmin
,chown -R newadmin:newadmin /backup/etc/packagename.conf
,emerge -av packagename
Your oldadmin did you a diservice, as each package that runs a service, should install it's own user and group, and the only way to ensure those groups are created or existing by reinstalling, and reinstalling will give the service the proper user. – eyoung100 Oct 30 '14 at 19:12