Is renaming the root account supported?
This document (000020537) is provided subject to the disclaimer at the end of this document.
While it is technically possible to rename the root account (uid=0), certain applications, scripts or 3rd party products may rely on the existence of a user called root. While such a configuration always targets individual environments, necessary adjustments outside of configuration files could be overwritten by vendor updates (e.g. files in /usr or /opt), so this becomes an ongoing task and is no one time setting. Especially in very complex setups involving 3rd party applications it needs to be verified with every involved vendor whether a rename of the root account is supported.
As the implications for renaming the root account cannot be foreseen, renaming the root account is not supported.
For possible actions on securing the root account please consult the Security and Hardening Guide for the respective SUSE Linux Enterprise product in use (https://documentation.suse.com/#sles -> select the version in use, then scroll down to Administration to review the Security and Hardening Guide).
Usually the idea behind renaming the root account is to hide or make it unpredictable. However, /etc/passwd requires 644 permissions for regular users for basic operations like ls or displaying the login name in a shell. As long /etc/passwd is configured with 644 permissions, any user of the given system is able to retrieve the login name for uid=0. The next consequence after renaming root would be to change the permissions of /etc/passwd, however, as soon the permissions change, e.g. basic userid resolution stops working:
linux:~ # useradd -m tux
linux:~ # passwd tux
Retype new password:
linux:~ # su - tux
I have no name!@linux:~> l
drwxr-xr-x 1 1000 users 140 Jan 7 10:21 ./
drwxr-xr-x 1 0 root 16 Jan 7 10:21 ../
-rw------- 1 1000 users 0 May 18 1996 .bash_history
-rw-r--r-- 1 1000 users 1177 Aug 6 17:45 .bashrc
drwxr-xr-x 1 1000 users 0 Mar 3 2021 bin/
drwx------ 1 1000 users 0 Mar 3 2021 .cache/
drwx------ 1 1000 users 0 Mar 3 2021 .config/
-rw-r--r-- 1 1000 users 1637 Apr 9 2018 .emacs
drwxr-xr-x 1 1000 users 0 Mar 3 2021 .fonts/
-rw-r--r-- 1 1000 users 861 Apr 9 2018 .inputrc
drwx------ 1 1000 users 0 Mar 3 2021 .local/
-rw-r--r-- 1 1000 users 1028 Aug 6 17:45 .profile
As can be seen above, usually the user prompt would be displayed as tux@linux:~>, and the column that usually displays the users name only shows the userid (1000).
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020537
- Creation Date: 07-Jan-2022
- Modified Date:07-Jan-2022
- SUSE Linux Enterprise Desktop
- SUSE Linux Enterprise Server
- SUSE Linux Enterprise Server for SAP Applications
- SUSE Manager Server
- SUSE Linux Enterprise Micro
- SUSE Manager Proxy
- SUSE Linux Enterprise HPC
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com