重置ubuntu的密码: Reset root password (Ubuntu Linux) without CD

转载自: http://www.faqforge.com/linux/reset-root-password-ubuntu-linux-without-cd/


Reset root password (Ubuntu Linux) without CD

Resetting your systems root password may be a necessary step if you have forgotten it or have bought a used computer which you don't want to setup anew. Doing so without any installation medium saves you a blank CD and a bit of time.

To start, restart your computer and get to the GRUB menu by pressingShift while booting. Point your cursor to the Recovery mode option:

Press e to edit the boot options. There, look for a line that looks like this: linux /boot/vmlinuz-3.2.0-18-generic root=UUID=b8b64ed1-ae94-43c6-92\d2-a19dfd9a727e ro recovery nomodeset:

The line will differ depending on your version and kernel but should have about the same syntax. Remove the last part of line which is ro recovery nomodeset and replace it with rw init=/bin/bash:

This will cause a command line to be opened on startup. Press F10now to reboot the machine and get to the command line. Once you are there, enter:

/usr/sbin/usermod -p '!' root

(If you get an error by copying and pasting above command, try replacing the quotation marks.) Now reboot the machine and the root password should be reset. The changes you did to the boot options will also reset automatically, so you do not have to change them back.


如果修改密码失败 unchange 则输入下面的命令:

The command to run prior to changing the password is: mount -rw -o remount /


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值