ubuntu初次安装没有root用户密码
新装的ubuntu系统没有root密码
使用su命令切换到root用户会出现以下提示

这是我们需要设置root用户的密码
sudo passwd

然后输入root密码按回车确认(在键入密码时候出口不会有任何变化)

再次输入密码按回车确认

出现以上信息就说明密码设置成功了

输入su命令
再输入root密码,成功切换到root用户
新装的ubuntu系统没有root密码
使用su命令切换到root用户会出现以下提示
这是我们需要设置root用户的密码
sudo passwd
然后输入root密码按回车确认(在键入密码时候出口不会有任何变化)
再次输入密码按回车确认
出现以上信息就说明密码设置成功了
输入su命令
再输入root密码,成功切换到root用户