You are not logged in.
sudo didn't work for me when, as root, I sudo'd as installer and then tried to change installer's password.
I thought sudo's failure message was telling me that sudo couldn't manipulate /etc/shadow because a tmpfs was mounted at /tmp with nosuid. Then I prevented tmpfs from being mounted on /tmp (systemctl mask tmp.mount). After that, sudo-ing now works but it still emits an alarming failure notice as shown below.
260411 10:21 /tmp root@manny{1}# sudo -u installer -s
rsync: [sender] send_files failed to open "/etc/shadow": Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.4.1]
bash: /etc/shadow: Permission denied
chown: failed to get attributes of '/tmp/shadow': No such file or directory
chmod: failed to get attributes of '/tmp/shadow': No such file or directory
rm: cannot remove '/tmp/shadow': No such file or directory
[installer@manny tmp]$ ls -l /etc/shadow
-rw------- 1 root root 809 Apr 11 10:20 /etc/shadow
[installer@manny tmp]$ passwd
Changing password for installer.
Current password:
New password:
Retype new password:
passwd: password updated successfully
[installer@manny tmp]$ sudo -s
[sudo] password for installer:
260411 10:24 /tmp root@manny#Last edited by SteveNewcomb (2026-04-12 11:25:49)
Offline
Please use "code" tags to format your posting.
Does the user "installer" have a weird login script rsync'ing shadow and manipulating "/tmp/shadow"?
Why is the timestamp of "/etc/shadow" only one minute old? Did you change a password one minute ago?
Offline
I wondered about that too (I mean about the call to rsync to copy /etc/shadow to /tmp). This is on a machine I'm just setting up from absolute scratch today. I figured it was some peculiar workaround inside sudo. I thought sudo would be convenient to use while configuring the new machine to impersonate a user I need in order to build AUR stuff.
I don't <i>think</i> I've done anything to cause rsync to be called by sudo, so this is as mysterious to me as to you.
I looked at /etc/bash.bashrc and ~/.bashrc and the former was the culprit. You were correct. I think that particular bash.bashrc is actually for a router running OpenWRT while it is still in the process of being fully configured. It does indeed mess with /etc/shadow! Yeow.
Now I have to figure out how it got there.
Sorry for the noise, and thanks for the help!
Last edited by SteveNewcomb (2026-04-11 18:01:12)
Offline
\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline