Ubuntu 下su: authentication failure 解决方法

104 阅读1分钟

问题描述

Ubuntu 中需要从普通用户切换到root用户,执行 su,然后输入当前用户的密码后报错: Authentication failure

解决方案

image.png

wr@wr-virtual-machine:~$ sudo passwd
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: password updated successfully

->sudo passwd

->Password:你当前的密码 

->Enter new UNIX password:这个是root的密码 
->Retype new UNIX password:重复root的密码 
然后会提示成功的信息。

使用susudo是有区别的,使用su切换用户需要输入所切换到的用户的密码,而使用sudo则是当前用户的密码。