Ubuntu – When to use sudo and when to use root

rootsoftware installationsudosystem-installation

I was looking some time on Internet what is the difference between sudo and root privileges,but there are many different explanations and commands that I do not need yet because I'm just a beginner.

Why we can install some applications and not the others etc.?
I tried to install some software but because i don't know that difference, i have errors

Best Answer

  • root is a user that has unlimited privileges.
  • sudo is the act of temporary elevating privileges of a normal user, but designated as an admin, to the level of the root user.

A reason we use sudo is because it makes it a little bit more difficult to remotely get into a machine: you now need to know the admin user name where previously you could assume the admin name was root.

Another reason is logging: when logs get written as "root did this" you know it happened but not by who. "sudo" writes log with the username, so when we have 2+ admins the logs include the user name who did the action.

sudo also allows for users to have limited admin access: you can have a user that can do a single task (or a few tasks) that need elevated permissions.

sudo makes a system better manageable.