You are not logged in.
Until a recent update, If I ran `su` as root I was able to impersonate any other user without being asked for a password:
[root@myhost]# su otheruser
[otheruser@myhost]$
Now, however, I'm asked to enter a password. No matter the password I enter (I can even simply press ENTER) I'm able to "su" to any user
[root@myhost]# su otheruser
Password:
[otheruser@myhost]$
This seems really strange, as I expect root to be able to "su" to any other user without any password (and this is actually what's happening, but I still get the useless password prompt).
Can anyone tell me what might be causing this?
Last edited by lazork (2016-09-16 06:46:19)
Offline
Have you made changes in your /etc/sudoers ?
"Yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the present." - Master Oogway
Offline
Works fine here. What kernel are you using?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
I made no changes to /etc/sudoers
/etc/sudoers:
root ALL=(ALL) ALL
/etc/sudoers.d/admin:
%admin ALL=(ALL) ALL
%sudo ALL=(ALL:ALL) ALL
Kernel version is 4.7.2-1.
Last edited by lazork (2016-09-15 15:43:41)
Offline
Don't bother with the sudoers file. That has nothing to do with `su`. You need not even have sudo installed (and thus no sudoers file) to use `su`.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Please post the output of the following commands:
$ which su
$ pacman -Qkk util-linux
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Please post the output of the following commands:
$ which su $ pacman -Qkk util-linux
I'd be curious about the which line as well. I once identified a break-in through this behavior, because something tried to hijack the su binary.
Offline
By looking at the output of `pacman -Qkk util-linux` (I didn't know about the kk option... I know, it's in the man page ), I found that, a long time ago, I modified two configuration files:
backup file: util-linux: /etc/pam.d/su (Modification time mismatch)
backup file: util-linux: /etc/pam.d/su (Size mismatch)
backup file: util-linux: /etc/pam.d/su-l (Modification time mismatch)
backup file: util-linux: /etc/pam.d/su-l (Size mismatch)
util-linux: 466 total files, 0 altered files
I did this on purpose to allow LDAP authentication (which I still need), and I followed the wiki page.
My /etc/pam.d/su and /etc/pam.d/su-l therefore contained (as the wiki suggests):
#%PAM-1.0
auth sufficient pam_ldap.so
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
auth required pam_unix.so use_first_pass
account sufficient pam_ldap.so
account required pam_unix.so
session sufficient pam_ldap.so
session required pam_unix.so
I switched the first two lines (placing pam_rootok.so before pam_ldap.so) and everything seems ok now.
The change I made, seems to make sense to me. Can you confirm it is better to place pam_rootok before pam_ldap?
Should I change the wiki?
P.S. Thank you all for the help. And for those curious, `which su` returns /usr/bin/su
Offline
I switched the first two lines (placing pam_rootok.so before pam_ldap.so) and everything seems ok now.
The change I made, seems to make sense to me. Can you confirm it is better to place pam_rootok before pam_ldap?
Should I change the wiki?
swapping those two means that pam_rootok.so is checked first, and is sufficient, so the ldap module is never used. it makes perfect sense.
Offline