/etc/sudoers file has following entries:-
## Allow root to run any commands anywhere root ALL=(ALL) ALL agupta ALL= /sbin/,/usr/sbin/,/bin/,/bin/cat /etc/sudoers ADMINS ALL= !/usr/bin/su, !SHELLS alice ALL =(%Children) /sbin/, /usr/sbin/, /bin/
alice is a member of the Children group; please find below are details for alice:-
[alice@localhost ~]$ id alice uid=1005(alice) gid=1004(Children) groups=1004(Children)
When I try to run this command
/bin/cat /etc/sudoers i get following errors:-
[alice@localhost ~]$ sudo cat /etc/sudoers Sorry, user alice is not allowed to execute '/bin/cat /etc/sudoers' as root on localhost.localdomain.
In /var/log/secure, I can see the following entries being populated:-
Mar 21 06:40:40 localhost sudo: alice : command not allowed ; TTY=pts/0 ; PWD=/home/alice ; USER=root ; COMMAND=/bin/cat /etc/sudoers
Any suggestions on this?
Modified the file by removing the impersonation from the file i.e.
alice ALL = /sbin/, /usr/sbin/, /bin/
I was able to run the command
sudo cat /etc/sudoers . I want to try out masquerading: but I am not able to make it work on my system
## Allow root to run any commands anywhere root ALL=(ALL) ALL agupta,myself ALL=(wheel) ALL jane ALL=(%parents) ALL
Command I ran:-
[jane@localhost ~]$ sudo -u paul cat /etc/sudoers [sudo] password for jane: cat: /etc/sudoers: Permission denied
Logs in /etc/log/secure:-
Mar 15 15:26:24 localhost sudo: jane : TTY=pts/2 ; PWD=/home/jane ; USER=paul ; COMMAND=/bin/cat /etc/sudoers
Members of the group parents:-
[root@localhost ~]# id jane uid=505(jane) gid=504(parents) groups=504(parents) [root@localhost ~]# id paul uid=504(paul) gid=504(parents) groups=504(parents)
Am, I still making any silly mistake?