问题
在Ubuntu服务器上,有sudo权限的用户,使用su命令切换到root用户时会失败,提示su: Authentication failure
jouzzy@amdyes:~$ su
Password:
su: Authentication failure
这是因为,su不加参数,其实是切换到root用户,而当前的sudo权限用户没有正确输入root用户的口令。
解决办法:
使用sudo passwd root
重置root用户口令
(这会导致root用户的口令发生变化)
jouzzy@amdyes:~$ sudo passwd root
New password:
Retype new password:
passwd: password updated successfully
jouzzy@amdyes:~$ su
Password:
root@amdyes:/home/jouzzy#
参考
https://blog.csdn.net/qq_39441603/article/details/127680941
https://blog.csdn.net/cjmcp/article/details/17655187