2

After understanding, what 'sudo' command does, I want to protect my computer from someone who wants to use this command for illegal purposes.

1 Answer 1

18

Don't add the specific user you don't want to give sudo access to sudo group.

sudo uses the configuration file /etc/sudoers and all files under directory /etc/sudoers.d/.

By default, the line in /etc/sudoers that dictates this behavior is:

%sudo   ALL=(ALL:ALL) ALL

Means all users of the sudo group can execute any command as any user on the system.

For legacy's sake there is a line for admin group too:

%admin ALL=(ALL) ALL

which is mostly unused nowadays.

So by default, unless you add the user to the sudo group, the user won't be able to execute commands using sudo.

3
  • 2
    And he should not be in /etc/sudoers... May 6, 2016 at 18:41
  • By default the user created when installing the system can run sudo. May 7, 2016 at 10:06
  • @ThorbjørnRavnAndersen Yes, that user is automatically added to sudo group.. The question implies what to do on a installed system..
    – heemayl
    May 7, 2016 at 10:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .