When the user sets bash, the error is to change the root bash to Bin/bash, note that it is not "/bin/bash"!. Then can not login root, also can not modify/etc/passwd. Resolution: 1, restart Ubuntu, then long press Shift into the Grub menu, 2, select recovery mode, that is Ubuntu,with Linux 3.2.0-23-generic (Recovery mode), press E, edit the startup parameters; 3. Change the RO recovery nomodeset to RW single init=/bin/bash;4, and then press ctrl+x or F10 to go to one-user mode, modify/etc/passwdroot:x:0:0:mysql User:/roo T:bin/bash instead: Root:x:0:0:mysql user:/root:/bin/bash restart. -----------------detailed pictures and texts are as follows:
root User Change Password method
Restart Ubuntu, then long press SHIFT to enter the Grub menu;
Select recovery mode, Ubuntu,with Linux 3.2.0-23-generic (Recovery mode), press E, edit the startup parameters,
such as
change ro recovery nomodeset to RW single Init=/bin/bash,
such as
Then press ctrl+x or F10 to enter single-user mode,
Restart Ubuntu, then long press SHIFT to enter the Grub menu;
Select recovery mode, enter confirm;
In recovery menu, select "root Drop to root shell prompt", enter confirm, such as;
Enter the shell interface and use the passwd command to reset the password: passwd root
Enter a new password;
Confirm the new password again;
See password setting successful prompt: Passwd:password updated successfully;
Reboot the system into GUI interface: sudo reboot;--------------reference: "1" How to reset Ubuntu login password and root user login system http://13521308103.iteye.com/blog/1930322
Root user Password change, password forgotten in Linux