I have a redhat enterprise linux that I am trying to configure for sudo, it is a personal machine and I dont care that much about relaxing the security settings.
I have the following two users, one is member of sba and teel groups and the other one is member sba group:
Code:
pre: sba, teel
mtpre: sba
Now I want to give sudo permissions to these two users so that they could execute any command using sudo without the need to specify a password. To do so I edited the /etc/sudoers file (it was not present at the beginning, I created the file) and added the following lines to it:
Code:
bash-4.1$ sudo cat /etc/sudoers
Password:
%admin ALL=(ALL) NOPASSWD: ALL
%teel ALL=(ALL) NOPASSWD: ALL
%sudo ALL=(ALL) NOPASSWD: ALL
%sba ALL=(ALL) NOPASSWD: ALL
mtpre ALL=(ALL) NOPASSWD: ALL
pre ALL=(ALL) NOPASSWD: ALL
bash-4.1$
The mtpre user can use sudo but need to enter password when using sudo and the pre user cannot use sudo at all.
Code:
[pre@machine1 ~]$ sudo cat /etc/sudoers
Sorry, user pre is not allowed to execute '/bin/cat /etc/sudoers' as root on machine1.
If I do a ls -al using the mtpre for the sudoers file I get:
Code:
bash-4.1$ ls -al /etc/sudoers
-r--r----- 1 root root 519 Mar 30 23:05 /etc/sudoers
Do you see any problem in the sudoers file (I used visudo to edit it and I am sure that syntactically it is fine as visudo did not complain about it) or anywhere that can cause this peculiar issue? Do you know any solution or any means of diagnosing the problem?
Thank you.
Bookmarks