Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Sudo as non root user don't work (Read 2182 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Sudo as non root user don't work

Hello and thank you in advance.
 In order to run any sudo command as non root user, Artix does not accept password. It displays that password is wrong.
 Going root goes fine (su -) but sudo (application) from non-root does not.
 I have been using Artix Openrc. Worked fine a few days ago.
 
Quote
#
## User privilege specification
##
root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
 %wheel ALL=(ALL) ALL
User is added in wheel group.

Re: Sudo as non root user don't work

Reply #1
Hello and thank you in advance.
 In order to run any sudo command as non root user, Artix does not accept password. It displays that password is wrong.
 Going root goes fine (su -) but sudo (application) from non-root does not.
 I have been using Artix Openrc. Worked fine a few days ago.
  User is added in wheel group.

So, did you type the passwd right?  :)  BTW, if you added your usr name in wheel group later, you need to log out and log in again to make it work.

Re: Sudo as non root user don't work

Reply #2
I typed password many times.
 Wrong password. Allways.
 But when I try "su -", it's possible.
 So sudo (application) - wrong password
 su - (it works).
 It's not fresh install, probably some update messed something up.

Re: Sudo as non root user don't work

Reply #3
I typed password many times.
 Wrong password. Allways.
 But when I try "su -", it's possible.
 So sudo (application) - wrong password
 su - (it works).
 It's not fresh install, probably some update messed something up.

"su -" takes the root's passwd; "sudo" takes your current user's passwd.

Re: [SOLVED} Sudo as non root user don't work

Reply #4
I know. I tried both paswords many times.
 Log in, log out, now it works.
 I just don't know what happened.

Re: [SOLVED} Sudo as non root user don't work

Reply #5
I know. I tried both paswords many times.
 Log in, log out, now it works.
 I just don't know what happened.
When you add yoru user to a group you must logout and login for it to take effect. Most likely you added yourself to wheel group, but it didn't take effect until you logged out.
Chris Cromer

Re: [SOLVED} Sudo as non root user don't work

Reply #6
It was not fresh install. Probably some update messed up something.

Re: [SOLVED} Sudo as non root user don't work

Reply #7
I'm not sure why, but this problem keeps coming back from time to time on my Artix system.  In the latest iteration, sudo whatever doesn't work but sudo su with no password at all does! My other systems are debian and slackware and I have never seen this problem on them.

EDIT: I have an intermittent problem with my keyboard: the Home key sometimes presses itself, screwing up password entry attempts among other things.

But why does sudo su work with no password? How can I disable that? Don't even know how it got enabled in the first place.

Re: [SOLVED} Sudo as non root user don't work

Reply #8
Can send us the output of this command?
Code: [Select]
grep -Ev '^[\s\t]*#|^$' /etc/sudoers

Re: [SOLVED} Sudo as non root user don't work

Reply #9



root ALL=(ALL:ALL) ALL
 %wheel ALL=(ALL:ALL) ALL
@includedir /etc/sudoers.d

The contents of /etc/sudoers.d
is a file called 10-installer which contains only:

 %wheel ALL=(ALL:ALL) ALL

Acutally, err, nevermind again. sudo su worked without password because I had just run sudo someothercommand shortly before it; after the sudo timeout expired, sudo su prompts for a password like I expect it to. Chalk this up to not enough coffee.

I'm not overly concerned with security as this is just a home laptop/desktop-replacement with a poor quality DSL internet connection that is down more than it is up, so permissive is ok.

Re: [SOLVED} Sudo as non root user don't work

Reply #10
Hi,
New Artix user here, I have used Arch for many years and wanted to try a different init system but remain Arch based.  So far my older dell optiplex 9020 seems to like it, but I was having a problem with sudo and %wheel too.

I installed artix-mate-openrc-20221121-x86_64.iso to my harddrive using the Live installer, I may have installed it while under the Live desktop option, it was a few weeks ago and I'm pretty sure it while I was under the Live option.
I also had a problem with sudo asking for my user password when using the %wheel option with NOPASSWD.  Now maybe this is because I used a Live desktop to install, I don't know I just know that that wasn't right, asking for my user passwd.
I looked at my 10-installer in /etc/sudoers.d but mine contained:

%wheel ALL=(ALL) ALL

that didn't seem right, perhaps it doesn't matter that it is

%wheel ALL=(ALL) ALL
and not
%wheel ALL=(ALL:ALL) ALL
?

anyways, I temporarily removed 10-installer from /etc/sudoers.d rebooted and now my sudo appears to be working correctly, it's not asking for my user passwd when using sudo with the %wheel and NOPASSWD option and appears to be using %wheel correctly.
Is 10-installer perhaps left over cruft from the Live installer that maybe should be removed?


Re: [SOLVED} Sudo as non root user don't work

Reply #11
>Is 10-installer perhaps left over cruft from the Live installer that maybe should be removed?

Probably, as neither I have such a file, and I installed through the base ISO.