Home > OS >  In the root directory performs a sudo chown root. The root * -r command, su can't go in
In the root directory performs a sudo chown root. The root * -r command, su can't go in

Time:11-22

Was trying to change the root directory create temporary folder owner for ordinary users, the results directly in the root directory performs a sudo chown user. The user * - R, after the sudo command and su all waste, because the owner/etc directory into the user,
Behind a big help, help me through the root SSH/etc of the owner to change back to the root, I will again in the root directory sudo chown root. The root * - R, sudo is no problem, but how the su execution is "su: authentication failed",
Try modifying the passwd:
Passwd root
Enter the new UNIX password:
Entering a new UNIX password:
Passwd: has been successfully updated password.
After the modification, su still returned authentication failure,
Do you have a great god know what this?

CodePudding user response:

The strace su to see that there is a problem

CodePudding user response:

reference 1st floor mouse_zhu response:
the strace su to see that there is a problem


Open ("/etc/shadow ", O_RDONLY | O_CLOEXEC)=1 EACCES (Permission denied)
Ll/etc/shadow can be seen: - rw - r - 1611-1 root shadow May 11 25/etc/shadow,
I also can't change the owner to root root, borrow other computer to perform the same command, and also shows the/etc/shadow Permission denied, but su upload password authentication through the, other error looking like language Settings

CodePudding user response:

Ordinary users use the sudo command to execute only root can execute permissions, and by the root user is different, because at that time he used or normal user environment variables,

Use the su - as the root user or some environment variables and root login is not the same, in addition, their uid is also different, only the euid is the same, (led)
  • Related