没有root密码的情况下怎么切换用户回root

问题遇到的现象和发生背景

Ubuntu 开始没有设置root密码,之后修改了默认用户为user普通用户。现在发现需要用到sudo权限,但没有办法切换回root。

我的解答思路和尝试过的方法

尝试使用 sudo su切换,和sudo passwd root修改密码,但都因为当前用户不具备权限无法实现。。
“ is not in the sudoers file. This incident will be reported.”

https://blog.csdn.net/m0_46128839/article/details/116133371

sudo su -