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
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
.
-
2
-
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..– heemaylMay 7, 2016 at 10:10