sudo: pam_open_session:权限不足
sudo: 策略插件会话初始化失败
首先确定sudo丢失原因,我是因为写错单词引起的 sudo权限丢失,又因为没有root密码;
修复方式:
- 重启ubuntu,快速按住【Esc】
- 进入【GRUB】界面选择【Advance options for Ubuntu】

- 选择【Ubuntu, with Linux 5.15.0-164-generic (recovery mode)】

- 选择【Root drop to a root shell prompt】模式,(等待时间可能比较长)

回车

此时获取root权限,进行修复