我需要重设密码。我已按照以下步骤操作:
但是,然后我转到“root”或“netroot”恢复选项,它告诉我:
Give root password for maintenance (or type Control-D to continue)
Run Code Online (Sandbox Code Playgroud)
显然,我不知道 root 密码。如果我输入CTRL+ D,我将返回到选项列表。从这个页面我读到:
在“另一种方式”一章下:
4. Highlight the line that begins kernel and press 'e' to edit`
Run Code Online (Sandbox Code Playgroud)
但是在 grub 配置文件中,我没有以kernel. 仅有的:
setparams 'Ubuntu...'
recordfail
set gxfpayload...
insmod part_msdos
insmod ext2
set root=...
search --no-floppy...
linux /boot/vmlinuz-2.6.38...
initrd /boot/initrd.img-2.6....
Run Code Online (Sandbox Code Playgroud)
这些都是我的 GRUB 中的所有行。我应该编辑哪一行?或者还有其他方法可以重置我的密码吗?
我目前已启动到恢复模式,因为我从管理员中删除了我的唯一用户:/
当我跑步时adduser oadams admin,我得到gpasswd: cannot lock /etc/group; try again later.
就其价值而言,ls /etc/ | grep "lock"仅返回mtab.fuselock,因此无需删除任何内容。
如何让我的用户回到管理员组?
我在创建管理员帐户时不小心输入了我的名字。尽管我设法改变在登录屏幕的用户名,我不能重命名/home/oldusername到/home/newusername。我尝试了大部分在线教程,但都失败了。
我试过的代码是这样的:
usermod -l newusername -m -d /home/newusername oldusername
Run Code Online (Sandbox Code Playgroud)
但输出是:
cannot lock /etc/passwd; try again later.
Run Code Online (Sandbox Code Playgroud)
如何解决问题并将文件夹更改为 newusername 并期望所有应用程序像以前一样工作?