Ubuntu 18.04.4 上使用 GRUB 双启动无需密码的 root 控制台

Ubuntu 18.04.4 上使用 GRUB 双启动无需密码的 root 控制台

我刚刚发现,进入恢复控制台(在与 Windows 双启动安装的 Ubuntu 18.04.4 中)可以无需输入任何密码即可进入根控制台。这似乎是一个巨大的安全黑洞,不是吗?

答案1

是的,这是为了恢复目的,例如当您忘记密码时,您仍然可以阻止某人在没有密码的情况下访问该 root shell,您可以启用 root 帐户并设置密码。正常启动 ubuntu 并登录到您的帐户。打开终端。现在:

$ sudo passwd root
Enter new UNIX password: new_root_password
Retype new UNIX password: confirm_root_password
passwd: Password updated successfully.

现在,每次您访问恢复根 shell 时,您都需要此根密码,并且只有您可以使用此根 shell 进行特殊恢复和管理目的。

相关内容