5

My user account on Ubuntu is olivier.

When I type the command groups olivier it returns:

olivier : olivier adm cdrom sudo dip plugdev lpadmin sambashare

So I am deducing I belong to the sudo group.

I have the following lines in my /etc/sudoers file:

#Allow members of group sudo to execute any command
%sudo    ALL=(ALL:ALL) ALL

If the members of group sudo can execute any commands, why do I need to use the sudo command when I want to execute a command with privileges (for example, a rm on a folder where I am not the owner) whereas I am logged with the user olivier?

1 Answers1

16

Having one's userid (or a group one is a member of) in the sudoers file gives one the capability to run commands as root (or other users, but that's advanced sudoers). It does NOT make one root all the time, which is what you seem to be assuming.

Speaking from a half century's experience with computers, being root all the time is too dangerous. Having to type sudo in front of the command gives one extra time to consider - will this shoot me in the foot?

Please read man sudo, man sudoers, man sudo_root.

waltinator
  • 37,856