About Administrative Access on Oracle Linux

By default, any user can elevate to a root shell by running the su command and providing the root user password when prompted.

su
Password:

Any user can also perform individual administrative tasks in their current shell, but those commands can't be run until the user provides the root user password:

su -c "whoami"
Password:
root

Important:

Don't share the root user password with anyone else or let remote users sign in as the root user, both of these actions constitute poor and highly risky security practices.

Elevating to a root shell by using the su command might be adequate in single-user environments, because only one person needs to administer the system and know the root user password. However, this approach is inadequate for shared systems with several users and administrators that require varying levels of access.

The sudo command is better suited for shared systems because any user can supply their own credentials when they elevate to a root shell:

sudo -s

Users exit from the root shell in the same way they would have if they had elevated directly with the su command and provided the root user password:

exit

In addition, users can run the sudo command to perform single administrative tasks with elevated permissions:

sudo whoami
root

For more information, see the su(1), sudo(8) and sudoers(5) manual pages.

Note:

You can optionally disable the root user during the Oracle Linux installation process and grant sudo administrator privileges to the first user.

In Oracle Linux 10, new users created during the installation process are granted administrative access by default.

For more information, see Oracle Linux 10: Installing Oracle Linux.