从Live CD轻松重置您的Ubuntu密码

Our last article on how to reset your Ubuntu password easily through the grub menu was quite popular, so I’ve decided to make a series on all the different ways to reset your password on either Linux or Windows… today’s lesson is how to use the Live CD to reset the password.

我们上一篇关于如何通过grub菜单轻松重置Ubuntu密码的文章非常受欢迎,因此,我决定就在Linux或Windows上重置密码的所有不同方式进行一系列的介绍。今天的课程是如何使用Live CD重设密码。

Note that we’ll also cover how to protect yourself against somebody else resetting your password, so stay tuned!

请注意,我们还将介绍如何保护自己免受他人重置密码的伤害,请继续关注!

image

Of course, this method will also work if you’ve installed your Ubuntu Live CD to a thumb drive.

当然,如果您已将Ubuntu Live CD安装到拇指驱动器上 ,则此方法也将起作用。

Resetting the Password

重设密码

You’ll want to boot from your Ubuntu Live CD, choosing “Try Ubuntu without any change to your computer” from the boot menu.

您需要从Ubuntu Live CD进行引导,从引导菜单中选择“在不更改计算机的情况下尝试Ubuntu”。

image

Once the system boots, open up a new Terminal window from Applications \ Accessories and then type in the following command:

系统启动后,从Applications \ Accessories打开一个新的Terminal窗口,然后键入以下命令:

sudo fdisk -l

须藤fdisk -l

This command is used to tell what device name the hard drive is using, which in most cases should be /dev/sda1, but could be different on your system.

此命令用于告知硬盘驱动器使用的设备名称,在大多数情况下应为/ dev / sda1,但在您的系统上可能有所不同。

image

Now you’ll need to create a directory to mount the hard drive on. Since we’re actually booting off the live cd, the directory doesn’t really get created anywhere.

现在,您需要创建一个目录来安装硬盘驱动器。 由于实际上是从实时CD引导,因此该目录实际上并没有在任何地方创建。

sudo mkdir /media/sda1

须藤mkdir / media / sda1

The next command will mount the hard drive in the /media/sda1 folder.

下一条命令会将硬盘驱动器安装在/ media / sda1文件夹中。

sudo mount /dev/sda1 /media/sda1

须藤挂载/ dev / sda1 / media / sda1

Now it’s time for the command that actually does the magic: chroot. This command is used to open up a shell with a different root directory than the current shell is using, and we’ll pass in the folder where we mounted the hard drive.

现在该实际执行命令的命令了:chroot。 此命令用于打开一个shell,该shell的根目录与当前shell所使用的根目录不同,我们将传递安装硬盘驱动器的文件夹。

sudo chroot /media/sda1

须藤chroot / media / sda1

Now you should be able to use the passwd command to change your user account’s password, and it will be applied to the hard drive since we are using chroot.

现在,您应该能够使用passwd命令来更改用户帐户的密码,并且由于我们使用的是chroot,它将被应用于硬盘驱动器。

passwd geek

密码怪胎

Note that you’ll have to type your username after the passwd command in order to change the right password.

请注意,您必须在passwd命令后键入用户名才能更改正确的密码。

image

Now you should be able to reboot your system and log yourself in with your new password.

现在,您应该能够重新启动系统并使用新密码登录。

翻译自: https://www.howtogeek.com/howto/linux/reset-your-ubuntu-password-easily-from-the-live-cd/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值