Skip to content
BENIBIX Learn

sudo vs Root User

People think sudo is the root user, and it is not. Root is an account that can change anything on the machine. sudo is a command that lets a normal user act as root for one line, after typing their own password. Each use is written to a log, so you can see who did what. Commands typed while logged in as root leave no such line.

Infrastructure⌨️ Linux & the Command Line

sudo

A command that runs one line as the root user. It asks for your password first.

sudo runs one command with the power of the root user. You type sudo before the command. It asks for your own password, not the root password. Only users on an allowed list may use it. Each use is written to a log, so there is a record of who did what.

Example
Jack needs to install a program on his server. He types sudo apt install nginx and enters his own password.
Why it matters
You get root power only when you need it. The rest of the time a typo stays small.
Full entry
Infrastructure⌨️ Linux & the Command Line

Root User

The boss account on Linux. It can change or delete any file.

The root user is the all-powerful account on a Linux system. It can read, change or delete any file, and run any command. Its user number is 0. Nothing stops root from making a mistake, even a deadly one. So you work as a normal user and borrow root only for one command at a time. Many servers stop root from logging in over the network.

Example
Emma's new server lets her log in as root. Her first job is to make a normal user and turn root login off.
Why it matters
Anyone who gets root owns the whole machine. Guarding it is the first job on any server.
Full entry

In one line

sudo
A command that runs one line as the root user. It asks for your password first.
Root User
The boss account on Linux. It can change or delete any file.