-2

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

Simon
  • 113
  • 1
  • 5
  • 14
  • " I tried to install some software but because i don't know that difference, i have errors" it is custom on AU to fix problems so why make this comment and not actually add the notices do they can get fixed? – Rinzwind Jun 28 '18 at 11:07
  • Some years ago I wrote this here: https://askubuntu.com/a/233395/3940 - I believe it may still help. – Takkat Jun 28 '18 at 11:10
  • 2
    Possible duplicate of [What is the difference between sudo X and running X as root?](https://askubuntu.com/questions/479357/what-is-the-difference-between-sudo-x-and-running-x-as-root) – steeldriver Jun 28 '18 at 11:32

1 Answers1

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

Rinzwind
  • 293,910
  • 41
  • 570
  • 710
  • 1
    +1; I'd add another advantage with `sudo`: After using `sudo command`, the shell returns to your regular user ID, and the following commands will be run with normal permissions. If you log in as `root` you may forget about it and continue to do 'normal' tasks as `root`, which increases the risk that you damage the system by mistake. – sudodus Jun 28 '18 at 11:57