我忘记了我的 sudo 密码。我想安装一个软件包,它需要我的 sudo 密码。每次我偶然输入密码时,我都会收到重试的错误。你能告诉我如何恢复它吗,或者我是否可以在终端中更改它非常感谢
答案1
来自 Ubuntu LostPassword 官方文档:
Reboot your computer.
Hold Shift during boot to start GRUB menu.
Highlight your image and press E to edit.
Find the line starting with "linux" and append rw init=/bin/bash at the end of that line.
Press Ctrl + X to boot.
Type in passwd username.
Set your password.