On unix, there are two kinds of users:
- root
- everyone else.
root is any username with a UID of 0. The username is typically root
, but doesn't have to be, and it is possible to have more than one root account with a different username (e.g. FreeBSD systems have root
with /bin/csh
as its shell, and toor
with /bin/sh
instead. They are both root, because they are both UID 0 - it is the UID which is important, not the name. There is only one root, but root can have aliases).
Ignoring security environments like SELINUX (which can limit what root is able to do), root (UID 0) can do anything on the system that the system is capable of - read, write, delete any file or directory, change ownership or permissions of files etc, bind a network socket to ports 0-1023, shutdown or reboot the system, etc.
All other users can only do what their permissions and group memberships allow. And programs like sudo
or su
, can give them some access to some root capabilities by temporarily elevating them to root, or via other mechanisms such as capabilities
on Linux.
NOTE: There is a sub-class of non-root users that are often called "system users". Despite what the name suggests, they are ordinary users. They just happen to be created for special purposes like running a particular daemon and owning that daemon's files and directories. e.g. user lp
for a printer daemon, ftp
for ftpd, postgres
for the postgresql database, and many more. They usually have a disabled password and their shell set to /bin/false
or /usr/sbin/nologin
or similar (user postgres
is a notable exception because it's fairly common to su
to user postgres to run psql
for maintenance tasks).
Quite often, system users have a matching or associated "system group", and sometimes a "system group" exists without an associated "system user" (e.g. group disk
has group ownership of device nodes for disks and partitions in /dev, and those devices are RW by group - meaning that any member of the disk group can read & write and even re-partition or re-format those block devices).
Most Linux systems reserve UIDs and GIDs 1 to 1000 (or 1 to 500, or similar) for system users (and most, but not all, system users have uids & gids within that reserved range). Non-system users, i.e. normal login accounts, get UIDs and GIDs above that reservation. This is a matter of OS vendor or even local site policy, not inherent to unix itself.
/
)