Root: The Account Behind a Program’s Administrative Power
Root is a powerful administrator account on Unix and related operating systems, including Linux. Programs running with its permissions can perform tasks ordinary accounts cannot, such as changing who owns a file or overriding certain restrictions on reading and changing it.
An operating system is the software that manages the computer's resources and enforces rules about access. The power given to root comes from those rules on that system. It isn't a universal rank above every other kind of administrator, or permission to control other computers on a network.
Linux in 100 Seconds
The system checks the program doing the work
A process is a running program. When it asks to read a file, change a setting or perform another protected action, the operating system checks the request against the user account and permissions associated with that process.
Traditional Unix systems distinguish privileged processes by an effective user ID of zero. A user ID is an account number used by the system; “effective” means the number that applies when permissions are checked. ID zero is known as root or the superuser.
That is why the account affects what a program can do. The same attempted action may be denied to an ordinary process and allowed to one holding the necessary administrative power.
For example, suppose a maintenance program needs to change a file that ordinary users cannot alter. Giving that program the appropriate privilege can let the maintenance succeed. If the program instead changes the wrong file, its permission doesn't become smaller because the action was a mistake.
The Linux documentation on access checks describes access decisions in terms of the requesting process, the target and the requested action. The check concerns what the program is allowed to do, even when the person who started it meant to do something else.
Linux can divide the traditional bundle
Root is associated with broad powers, but Linux can separate those powers into capabilities. Here, a capability means a specific privilege, such as permission to change file ownership or override certain ordinary file permissions.
That separation allows a more precise question than “does this program have root?” Which powers does it actually hold and use?
The Linux capabilities manual explains the division of traditional root privileges. Different capabilities govern different operations; possessing one doesn't describe every action the process is allowed to take.
This supports least privilege: limiting a program to the access its work requires. The practical purpose is to avoid giving an unrelated task administrative powers just because another part of the system needs them.
A program’s available capabilities and the system’s other security rules determine which requests succeed.
- Get comfortable in Linux quickly, starting from zero.
- Learn the commands and scripting that security work depends on.
- Build the base for everything else you study in security.
Android supplies a visible boundary
Android uses SELinux, short for Security-Enhanced Linux, to enforce an additional set of access rules. These are mandatory access controls: rules applied by the system that a process cannot disregard simply because it has ordinary permission to a resource.
According to the Android Open Source Project's documentation, those controls apply even to processes with root or superuser privileges. In enforcing mode, disallowed actions are blocked.
A process can therefore hold powerful privileges and still be blocked by a rule the operating system enforces.
“Rooting” a device refers to obtaining elevated privileges, but physical possession and operating-system permission are different things. Owning the hardware doesn't itself tell you which powers a running program has been given. The active security rules still determine what its programs can change.
Least Privilege: Give Each Account the Power Its Work Needs

Linux Kernel Capabilities: Which Powers Does a Program Need?

Unix: A Family History, a Standard and a Set of Permissions

QUOTE:
"Amateurs hack systems, professionals hack people."
