On Linux, everything starts at "root." The hard drive has a root partition ( Show These days, though, the root user is redundant to requirements. The Anaconda installer can create an initial user for you, and then you can perform
"superuser" tasks with the Lock root at installationAn attacker with enough knowledge to attempt a break-in also knows that every Unix and Linux system once had a user called During installation, you have the option to lock the root account. (Seth Kenlon, CC BY-SA 4.0)Locking the root account prevents you from logging in as the root user. If you do that, grant the user you create administrative privileges during user creation. (Seth Kenlon, CC BY-SA 4.0)Making the user an admin adds that user to the special
[ Free download: Advanced Linux commands cheat sheet. ] Disable rootIf you didn't lock the root account during installation, or if you're unsure, then you can disable the root account later, as long as you have administrative privileges. If you don't, then use the root account to add your user to the
sudoers file and then use To disable root, set the root shell to
Test your change by attempting to switch to the superuser account with
Delegate administrationThe Suppose you want to grant a user permission to run a specific application, such as the To grant selective privileges to a single command
or a group of commands, edit
Find the section of the sudoers file defining command permissions, and add the user and command you want to allow. For instance, to permit the user
Test it out by switching to that user's account and running the command:
Sudo aliasesYou can create aliases in the sudoers file to group hosts, commands, and users together. You could have, for instance, an admin group that could use commands such as [ Free online course: Red Hat Enterprise Linux technical overview. ] The sudoers file provides example syntax, but here's an example of allowing all users in the Unix group
Protect your admin privilegesEverything from mission-critical machines to computers with customer data, and even your own humble personal laptop, are too important to casually lend the keys out to anyone who needs an escalation of privilege. Disable the root account to
avoid broad permission escalation, and use the What is the command to run a program with root privilege?The sudo command exists to temporarily give you root-level privileges when you need them to administer the system. You can also use the commands gksudo or su .
What is root privileges in Linux?Root privileges are the powers that the root account has on the system. The root account is the most privileged on the system and has absolute power over it (i.e., complete access to all files and commands).
|