Level user switching failed

Problem: The switching of the level user fails, but it can be switched through root
Reason: The level switching user needs to obtain the switching user password, because the previously set user's password is wrong, causing the switching failure
Reasons for incorrect password setting: When using echo and keyboard input, forget the password behind echo and forget the double quotes, resulting in a password you do n’t know;
The user switching through root does not require a low-privilege password, so the switch is successful
Incorrect naming: echo redhat | grep passwd user1
Correct command: echo "redhat" | grep passwd user1 
The following is a screenshot of failed user switching
 
The password is set successfully, and the user is switched successfully.

 

 

 

 

Guess you like

Origin www.cnblogs.com/L6y1a/p/12693478.html