Showing posts with label disable sudo permissions. Show all posts
Showing posts with label disable sudo permissions. Show all posts

Monday, April 22, 2013

Disable sudo privileges for user

If you want, user should not execute command with sudo.
To remove sudo permissions for user, follow the process.

1. Change the group of user. To see how to change the group of a user click here.

2. Do not define the group in file /etc/sudoers
     A group-name is started with symbol % in  /etc/sudoers
     Comment the line in /etc/sudoers
    #%group-name ALL=(ALL) ALL
Above line without comment gives sudo permission to all users of the group.
If you comment this line, no user of the group can use sudo while executing any command.

3. Now whenever user tries to run command with sudo, it says
 Error - username is not in the sudoers file. This incident will be reported.