You are not logged in.

#1 2012-05-14 17:36:03

Gumper
Member
From: U.S.A.
Registered: 2009-10-26
Posts: 132

Sudo not reading from sudoers.d

I have an entry in a file called losetup that is located in /etc/sudoers.d. Until recently when I would run "sudo losetup", sudo would use the permissions configured in the /etc/sudoer.d/losetup file.

Now it is not working anymore. It appears that sudo is not reading the contents of the /etc/sudoer.d/losetup file. If I comment out this file and add it's contents to the standard sudo file using visudo, then everything works ok.

Any ideas why sudo is not accessing sudoers.d?

The code that I'm using in the losetup file is as follows:

gumper ALL=NOPASSWD: /sbin/losetup

Ready yourselves, ready yourselves
Let us shine the light of Jesus in the darkest night
Ready yourselves, ready yourselves
May the powers of darkness tremble as our praises rise .... Casting Crowns-Until The Whole World Hears.

Offline

#2 2012-05-14 18:58:29

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Sudo not reading from sudoers.d

Maybe the syntax is wrong.

https://wiki.archlinux.org/index.php/Sudo#Using_visudo

^ I wonder if you can change this alias to edit (with a sanity check) the /etc/sudoer.d/losetup instead of /etc/sudoers. Hmmm... But why do you need a separate file for anyway? I thought the whole point of the rc.conf file (which is specific to Arch and to *BSD) was to bring several settings in one place, instead of scattered across the system.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#3 2012-05-14 19:27:17

Gumper
Member
From: U.S.A.
Registered: 2009-10-26
Posts: 132

Re: Sudo not reading from sudoers.d

DSpider wrote:

Maybe the syntax is wrong.

I don't think that is the issue as it worked correctly before. Plus when I add the exact same lines to the /etc/sudoers file, it works ok.


But why do you need a separate file for anyway? I thought the whole point of the rc.conf file (which is specific to Arch and to *BSD) was to bring several settings in one place, instead of scattered across the system.

From what I've read my understanding is that it's better to use sudoer.d and keep the /etc/sudoers file unchanged. The files in /etc/sudoers.d are not changed when upgrades or changes to sudo are made. Whereas /etc/sudoers could be changed.


Ready yourselves, ready yourselves
Let us shine the light of Jesus in the darkest night
Ready yourselves, ready yourselves
May the powers of darkness tremble as our praises rise .... Casting Crowns-Until The Whole World Hears.

Offline

#4 2012-05-14 19:51:49

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Sudo not reading from sudoers.d

Nah. I'm still using the exact same /etc/sudoers file (permissions and all) from the install I did 3 years ago on a different computer. The sudo package has been updated several times since then. No issues whatsoever.

Have you tried rebooting?


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#5 2012-05-14 20:03:05

Gumper
Member
From: U.S.A.
Registered: 2009-10-26
Posts: 132

Re: Sudo not reading from sudoers.d

Yes, I tried rebooting. Same results.


Ready yourselves, ready yourselves
Let us shine the light of Jesus in the darkest night
Ready yourselves, ready yourselves
May the powers of darkness tremble as our praises rise .... Casting Crowns-Until The Whole World Hears.

Offline

#6 2012-11-18 16:12:20

fwolf
Member
Registered: 2012-11-18
Posts: 3

Re: Sudo not reading from sudoers.d

Just a note:
sudo will read each file in /etc/sudoers.d, skipping file names that
end in ~ or contain a . character ...

This solve my sudoers.d/ file not working problem, found here:
http://bugs.centos.org/view.php?id=5017

Hope this helpful.

Offline

#7 2012-11-18 16:30:18

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Sudo not reading from sudoers.d

@fwolf, that is good information in general, but if you read the thread, you would have seen that the file in question is /etc/sudoers.d/losetup (I see no ~ or . there).

Offline

#8 2012-11-18 16:34:04

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: Sudo not reading from sudoers.d

Also, since he's new here he might want to read the forum rules as this is a bit of a necrobump. https://wiki.archlinux.org/index.php/Forum_Etiquette


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#9 2012-11-18 16:52:06

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,721

Re: Sudo not reading from sudoers.d

bgc1954 wrote:

A...as this is a bit of a necrobump. https://wiki.archlinux.org/index.php/Forum_Etiquette

A  bit old. but relevant.   Leaving open...


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#10 2015-06-04 22:30:05

gezerati
Member
Registered: 2015-06-04
Posts: 1

Re: Sudo not reading from sudoers.d

I had the same problem. Turned out there was a group setting in the sudoers file, after the include statement, that is overwriting the permissions set in the file included from /etc/sudoers.d

eg

#includedir /etc/sudoers.d
%group     ALL=(ALL) ALL

if the user, is part of the group, then the specific user permissions set in the included file will be trashed by the group statement in sudoers

Offline

#11 2015-06-04 22:40:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Sudo not reading from sudoers.d


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB