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.
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.
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.
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.