sudo service file exists to make sure that privileges called for don't stay after a reboot. Basically it guarantees that after rebooting, normal users that called for root permissions will stay as normal users.
A detailed explanation about sudo
All of the explanation below is to get all the information for everyone that reads this question and to then explain what the sudo file in the service folder is doing there.
When you install Ubuntu or any other distro that uses
sudo the difference between being root and being a user that uses
sudo for gaining "root like" privileges (Administrative or super user Privileges) is the following:
- You are not asked for a password for each or all commands you run on a session
- Not all commands you execute will be logged by default
- The system assumes you know what you are doing (Reason why it does not ask for a password each time you execute a command)
- There is no second chance or last minute option if you make a mistake
- You are asked for a password for each or all commands you run on a session. For example if you open a terminal and execute a command that needs administrative privileges it will ask the password once for that session until you close the terminal or logout. This varies depending on what command you use and where. It might ask once or multiple times.
- All commands you execute will be logged since you are actually asking for permission to use a super user privileged command.
- The system assumes you e asking for permission temporarily and the administrative right will be lent temporarily (Until you logout, close terminal, etc..)
- You have a last minute option to correct any mistake. This is done in the moment you get asked for the password.
Why was SUDO Created
The creation of SUDO was done because in the past, using root created more problems than solutions. Users had all rights, which meant that if they did some spring cleanup and literally deleted the
/bin folders (because they thought they did not needed them).. guess what would happen. Many problems in the past were because users did not know the power they had when using root. Basically they had root but did not understand Linux, the file system hierarchy, what files were important, etc.. (Something like having a ferrari and not knowing how to drive... in a highway!)
SUDO is also used by GUI apps (Like Update Manager) when they need temporary administrative privileges to do something. They only need it for a specific amount of commands (Typically 1) and then they go back to the user level privilege. This is to avoid having root privileges all the time and to avoid making a mistake if the user decides to remove some important part of the system.
Additionally it gives a better security because the root user comes disabled by default.
Last, if you have a Desktop PC or Server, you really do not want everyone to be root, nor to have all admin privileges. Very bad idea if your little sister or little brothers starts to wonder what would happen if
/boot met DEL key. This is where
sudo comes in to decrease the chance something bad happens.
What does Provide limited super user privileges to specific users mean?
sudo user or sudoers actually have a configuration file that tells them how limited or opened the sudo command for a specific user is. The file
/etc/sudoers has all information to limit or give access to a sudo user. By default it comes with access to everything, but you can configure or limit this as you wish.
For information on how to use the sudoers file type
man sudoers in a terminal. For example the normal format is:
USER HOST = COMMANDS
cyrex server1 = /bin/ls will give the user cyrex in the host server1 access to run the ls command.
cyrex server1 (root) = /bin/ls will give the user cyrex in the host server1 access to run the ls command as root.
cyrex ALL = /bin/ls will give the user cyrex in all hosts access to run the ls command.
cyrex ALL = ALL will give the user cyrex in the all hosts access to run all commands.
luis ALL=(root) NOPASSWD: /bin/kill, /usr/bin/killall will allow me to run sudo for the
killall commands as root without asking for a password.