给新装的Ubuntu18.04设置root密码

lichengbei

2019-12-21

Ubuntu初始安装没有给root用户设置密码,使用su命令切换到root就会抛出 su : Authentication failure 异常。

解决办法就是root用户设置一个初始密码,操作如下:

lichengbei@ubuntu1804:~$ sudo passwd root

[sudo] password for lichengbei: {1234.qwer}

Enter new UNIX password: {1234.qwer}

Retype new UNIX password: {1234.qwer}

passwd: password updated successfully

lichengbei@ubuntu1804:~$ su

Password: {1234.qwer}

root@ubuntu1804:~#

说明一下,命令行输入内容前的提示符$代表一般用户,#代表root用户, exit 命令退出root并返回普通用户。

猜你喜欢

转载自www.cnblogs.com/lichengbei/p/12079185.html