3

Does root not require a password to log in as a user even though a password has been set for that user?

When I am logged in as "root", su user logs me in as "user". There is no prompt for a password. From there su user requires a password. Is this normal?

Debian 6 here.

  • Root user is the system. It can do anything it pleases. – Ruslan Jul 11 '14 at 8:39
  • Root is the super User so he can do what ever he want, every Other user have a user id number, But Root have the id as 0, just run the command id root. – Babin Lonston Jul 11 '14 at 12:16
7

Yes, it's normal. The root user can do anything (including, say, changing a user's password, logging in as them, and changing it back), so they aren't restricted by su (or sudo). That includes password prompts and any other restrictions.

The PAM configuration can be set up to have su present certain prompts to the root user still, for example encryption keys, but it isn't the default, it isn't reliable, and it can be disabled. The root user can easily switch to another user by other means, like creating a setuid executable owned by the user or just calling the setuid function in one of their programs.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.