You are not logged in.
I installed arch in a virtualbox VM. I am a seasoned user of arch, and that issue plays with my nerves.
It's a basic install, I have added Xorg, Firefox, openbox, rxvt-unicode.
I like to use sudo, and get that problem I never had before. It says my user is not allowed to use sudo, while I have added access to wheel group and my user is in this group.
I created a /etc/sudoers.d/10-wheel.conf containing
%wheel ALL=(ALL) ALLto avoid modifying /etc/sudoers (content written with visudo -f /etc/sudoers.d/10-wheel.conf).
Perms for sudoers files are correct:
# ls -l /etc/sudoers*
-r--r----- 1 root root 3174 13 janv. 13:40 /etc/sudoers
/etc/sudoers.d:
total 4
-r--r----- 1 root root 21 4 juil. 13:32 10-wheel.confMy user arch (uid 1000, gid) is in wheel group:
$ groups
ftp http users wheel adm archWhen I want to use sudo, I get this error:
$ sudo -s
[sudo] password for arch:
arch is not in the sudoers file. This incident will be reported.(the real command is LANG=C sudo -s to get message in english, my locale is french)
Trying to list rights from root:
# sudo -l -U arch
User arch is not allowed to run sudo on archvm.My /etc/hosts
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 localhost archvm
::1 localhost
#127.0.0.1 archvm.localdomain archvmThe commented line is what I had before testing different things to make sudo working.
I suspect there is something with hostname resolution or something like that, as I don't see why sudoers rules are not processed.
Any idea?
Edit the drop-in file extension was the issue, because sudo does not process a file containing dots.
Last edited by riri (2019-07-04 14:32:34)
Offline
How does your /etc/sudoers file look?
Do you have other drop-in files in /etc/sudoers.d?
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
I didn't touch to /etc/sudoers at all, it's the one installed.
It contains at the end the statement #includedir /etc/sudoers.d
No other drop-in files in sudoers.d
To be sure I use the default sudoers, I uninstalled/reinstalled sudo, after I tried to uncomment the line with %wheel in /etc/sudoers (no better)
Offline
Does it work if you remove the # from in front of the "include" directive?
The # is part of the #includedir statement. Changing directly sudoers does not help either
Offline
Ok now it works, but I will never know why it didn't before.
To try again following 2ManyDogs comment, I have uncommented again the line for wheel group... and it worked.
So I have uncommented it again to use my sudoers.d/10-wheel.conf, killed my sudo timestamp with sudo -k and tried again... it worked!
I have not made any other change, but used tmux in my urxvt. If I try directly from urxvt or a tty, it works too.
If ever I get the idea of why it didn't want to work, I will update here.
Offline
Can you give us the outputs of
sha256sum /etc/sudoers /etc/sudoers.d/10-wheel.confInofficial first vice president of the Rust Evangelism Strike Force
Offline
Ha, I was still in visudo when I wanted to do my last test, so commenting %wheel was not taken in account.
So it works when I put the rule in /etc/sudoers, not when I use the drop-in file /etc/sudoers.d/10-wheel.conf
# cat /etc/sudoers.d/10-wheel.conf
%wheel ALL=(ALL) ALL# sha256sum /etc/sudoers.d/10-wheel.conf
9db7f67e68218e51ee549cba0949aae86b6c14a48ac40b851cf76aba951f70a7 /etc/sudoers.d/10-wheel.confLast edited by riri (2019-07-04 14:00:32)
Offline
My /etc/sudoers file with
# cat /etc/sudoers | curl -F 'f:1=<-' ix.io
http://ix.io/1NGIAnd /etc/sudoers.d/10-wheel.conf with
cat /etc/sudoers.d/10-wheel.conf | curl -F 'f:1=<-' ix.io
http://ix.io/1NGJOffline
The .conf suffix is the problem.
sudo will suspend processing of the current file and read each file in /etc/sudoers.d, skipping file names that end in ‘~’ or contain a ‘.’ character to avoid causing problems with package manager or
editor temporary/backup files.
Last edited by schard (2019-07-04 14:13:38)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
The .conf suffix is the problem.
Exactly, I renamed the file and it works. Thank you schard!
Offline