Under normal circumstances, if I want to switch to root can be directly with sudo-i and then enter the password login root, but today read the textbook said Linux is used su-root switch, so the hand cheap try, and then appeared su:authentication failure error hint , and then online search to find solutions, as follows:
$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd:password updated successfully
After the success of the SU-input password can be switched to root, by default su is switched to root, and ru-root effect is the same.
Later I want to reproduce the above process, and found that as long as you sudo passwd root once, the next time Su time as long as the input password can be successfully logged in, will not appear su:authentication failure problems.
----------------------------------Update 20131229-------------------------------
Today, I accidentally tried again Su and su-root, the results are not the same:
myubuntu@ubuntu:~/desktop$ su
Password:
root@ubuntu:/home/myubuntu/desktop# exit
exit
myubuntu@ubuntu:~/desktop$ su-root
Password:
root@ubuntu:~# exit
logout
myubuntu@ubuntu:~/ desktop$ Su-
Password:
root@ubuntu:~#
It is known that the current path pwd unchanged after Su to root, and su-root or RU-cut to root after the root directory of root.