20

sudo (Which I have configured to ask for a password) is rejecting my password (as if I mis-typed it) I am absolutely not typing it incorrectly. I have changed the password temporarily to alphabetic characters only, and it looks fine in plaintext, in the same terminal. I have my username configured thus:

myusername ALL=(ALL) ALL

I am using my password, NOT the root password, which are distinct. Just to be sure, I've tried both (even though I know the root password is not what I should use) - neither work.

I have added myself to the group 'wheel' additionally, and included the following line:

%wheel ALL=(ALL) ALL

I'm kind of at the end of my rope here. I don't know what would cause it to act as though it was accepting my password, but then reject it. I have no trouble logging in with the same password, either at terminal shells, or through the X11 login manager.

3
  • sudo would generate a log message, perhaps in /var/log/secure (I don't know how syslog is configured in arch), explaining what it found wrong. Sep 6, 2012 at 2:36
  • Do you have a sudoers entry in /etc/nsswitch.conf? (it could be configured to look up the user incorrectly)
    – phemmer
    Sep 6, 2012 at 2:47
  • also the output of sudo -l could help, in arch the sudo log messages go to /var/log/auth.log
    – Andy H
    Sep 6, 2012 at 2:52

2 Answers 2

26

Another possible cause is that systemd-homed is not running. Check it's status with

systemctl status systemd-homed

If it says something other than active, use

systemctl start systemd-homed

to start it again. Note that you need superuser privileges in order to run that command. As sudo is not working, you might try logging as root using

su root

and the correct password for root (usually not your regular user).

5
  • 2
    Would you mind expanding on this? On my systems, systemd-homed isn't running, and sudo works fine. Oct 22, 2020 at 7:58
  • 3
    Of course. On my system, systemd-homed wasn't running as well. Out of a sudden, all attempts to use sudo with the correct password failed. su root with root's password failed as well. So I checked the systemd journal and found an error message that said, /home/<user> was not a valid home directory, as systemd-homed was not running. Starting it manually fixed the issue temporarily, so I could at least reboot the machine using super user rights. Since then, the issue only occured sporadically, but not very often.
    – LukeLR
    Oct 29, 2020 at 17:46
  • Thanks for sharing this -- it seems the default PAM configuration that comes with Arch Linux has a hard dependency on it running, but if you have an older installation and didn't update the PAM configs, obviously that doesn't apply.
    – Chris Down
    Dec 11, 2020 at 2:27
  • Thanks, this works for me.
    – kaiya
    Aug 6, 2022 at 20:39
  • This is a great suggestion if you’re using systemd-homed, but useless if you’re not. Oct 16, 2023 at 3:50
7

Oh what the heck, here was the issue, I guess?

https://bbs.archlinux.org/viewtopic.php?id=142720

pacman -S pambase

fixes it.

1
  • 3
    Not working for me
    – Vlad
    Mar 14, 2020 at 6:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .