Is it possible to safely downgrade the user 'root', replacing it with a different account name? (say 'admin'). So, in the end, 'admin' would be uid 0 and 'root' 123.
I am using Centos, if that makes any difference. What worries me is if any of the standard services use root hardcoded (cron scripts maybe?) and that causes everything to fail.
Thanks!
In essence you want to rename the account named
root
. If you think about it, that's the same as replacing it with a different account (same uid, different name).Plenty of people will tell you not to, however if you take everything into consideration, it could be done and that without terrible consequences. The trouble comes when an application or script assumes that the root user is named
root
rather than searching for the root user via uid. I think that's not as much of a problem now as it once was.What you'll need to do is edit
/etc/passwd
,/etc/shadow
,/etc/group
, and/etc/gshadow
. From there, the changes will need to be application specific. For instance, for postfix, you'll likely want to greproot
in/etc/
and change the aliases to point to the new name.Other apps will need to be dealt with as needed. For much more info, there's a question over on unix.stackexchange.com titled "How do you rename root?" that has an interesting, CentOS specific answer from someone who sought PCI compliance for his organization by changing the default name for the root account.
P.S. Back everything up twice before you edit your system files.