ubuntu重置密码忘记_在2分钟或更短时间内重置您忘记的Ubuntu密码

ubuntu重置密码忘记

ubuntu重置密码忘记

If you’ve ever forgotten your password, you aren’t alone… it’s probably one of the most common tech support problems I’ve encountered over the years. Luckily if you are using Ubuntu they made it incredibly easy to reset your password.

如果您忘记了密码,那么并不孤单……它可能是我多年来遇到的最常见的技术支持问题之一。 幸运的是,如果您使用的是Ubuntu,则可以轻松地重置密码。

image

All it takes is adjusting the boot parameters slightly and typing a command or two, but we’ll walk you through it.

所需要做的只是稍微调整启动参数并输入一个或两个命令,但是我们将逐步指导您。

Reset Your Ubuntu Password

重置您的Ubuntu密码

Reboot your computer, and then as soon as you see the GRUB Loading screen, make sure to hit the ESC key so that you can get to the menu.

重新启动计算机,然后在看到GRUB Loading屏幕时,请确保按ESC键,以便进入菜单。

image

Root Shell – Easy Method

根壳–简单方法

If you have the option, you can choose the “recovery mode” item on the menu, usually found right below your default kernel option.

如果您有此选项,则可以在菜单上选择“恢复模式”,该选项通常位于默认内核选项的正下方。

image[3]

Then choose “Drop to root shell prompt” from this menu.

然后从此菜单中选择“ Drop to root shell提示”。

image[6]

This should give you a root shell prompt.

这应该给您一个root shell提示。

Alternate Root Shell Method

备用根壳法

If you don’t have the recovery mode option, this is the alternate way to manually edit the grub options to allow for a root shell.

如果没有恢复模式选项,则这是手动编辑grub选项以允许使用root shell的另一种方法。

First you’ll want to make sure to choose the regular boot kernel that you use (typically just the default one), and then use the “e” key to choose to edit that boot option.

首先,您需要确保选择要使用的常规启动内核(通常只是默认的启动内核),然后使用“ e”键选择编辑该启动选项。

image

Now just hit the down arrow key over to the “kernel” option, and then use the “e” key to switch to edit mode for the kernel option.

现在,只需将向下箭头键移至“内核”选项,然后使用“ e”键切换到内核选项的编辑模式。

image

You’ll first be presented with a screen that looks very similar to this one:

首先,您将看到一个类似于此屏幕的屏幕:

image

You’ll want to remove the “ro quiet splash” part with the backspace key, and then add this onto the end:

您将需要使用Backspace键删除“ ro quiet splash”部分,然后将其添加到末尾:

rw init=/bin/bash

rw init = / bin / bash

image

Once you hit enter after adjusting the kernel line, you’ll need to use the B key to choose to boot with that option.

调整内核行后按Enter键,您将需要使用B键选择使用该选项进行引导。

image

At this point the system should boot up very quickly to a command prompt.

此时,系统应非常快速地启动到命令提示符。

Changing the Actual Password

修改实际密码

You can use the following command to reset your password:

您可以使用以下命令来重置密码:

passwd <username>

passwd <用户名>

For example my username being geek I used this command:

例如,我的用户名是极客,我使用了以下命令:

passwd geek

密码怪胎

image

After changing your password, use the following commands to reboot your system. (The sync command makes sure to write out data to the disk before rebooting)

更改密码后,使用以下命令重新引导系统。 (sync命令确保在重启之前将数据写出到磁盘上)

sync reboot –f

同步重启–f

I found that the –f parameter was necessary to get the reboot command to work for some reason. You could always hardware reset instead, but make sure to use the sync command first.

我发现–f参数是使出于某种原因重新启动命令运行所必需的。 您总是可以通过硬件重置来代替,但是请确保首先使用sync命令。

And now you should be able to login without any issues.

现在,您应该可以顺利登录了。

翻译自: https://www.howtogeek.com/howto/linux/reset-your-forgotten-ubuntu-password-in-2-minutes-or-less/

ubuntu重置密码忘记

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值