I am root in a system. There seems to be a passwordless user in this system I try becoming a different specific user by using "su - username", and get a "Password" prompt. No matter if I enter a password, or not enter a password and just press enter, I still become that user. Why is this?
Normally root doesn't get a password prompt at all. Linux's
su doesn't support passwordless accounts;
login allows any password if the account is passwordless.
The behavior you describe sounds like a bad PAM configuration, perhaps lines in the wrong order. Check your PAM configuration:
/etc/pam.d/su and any included file. The important lines are the
A typical basic configuration for
auth sufficient pam_rootok.so auth required pam_unix.so
I don't know what the default setup is on CentOS, it might be more complex to allow LDAP authentication, Kerberos, home directory automount, etc. If you need help understanding it, post your PAM configuration (at least every
auth line that applies to
su, in the right order).