What is the difference between sudo X and running X as root?
Solution 1:
That's somewhat too broad to explain it will end with conclusion like in a link that you linked to your question, but I'll try something more fullfilled maybe it will give you some answers.
sudo
("substitute user do") allows a system administrator to delegate authority to give certain users (or groups of users) the ability to run some (or all) commands as root
or another user while providing an audit trail of the commands and their arguments.
Sudo
is an alternative to su
for running commands as root
. Unlike su
, which launches a root
shell that allows all further commands root
access, sudo
instead grants temporary privilege escalation to a single command. By enabling root
privileges only when needed, sudo
usage reduces the likelihood that a typo or a bug in an invoked command will ruin the system. Sudo
can also be used to run commands as other users; additionally, sudo
logs all commands and failed access attempts for security auditing.
More detailed info about Root Sudo
can be found on Official Ubuntu Documentation