忘记Ubuntu9.04的root密码真正可用的还原方法

网上找了一天!!! 我遇见的中文的修复密码教程全部不能用(什么修改Grup内核啦, 删除Root密码啦, 复制其他用户密码到Root密码啦, 或者什么获取root权限之后使用passwd来修改啦, 全是不能使用在以下的环境中:

① Ubuntu9.04 amd64 desktop

② 启用了Root, 并设置了Root密码

③ 把目录 /, /home, /etc 等关键目录挂载在不同的分区上

所以就求助于英文了.

结果真找到了: (懒得翻译了, 因为这篇文章估计没几个会看到. 如果你要我翻译, 就发邮件给我吧: lanshunfang#gmail.com -- 把#替换成@)

URL: http://ubuntuforums.org/archive/index.php/t-1177638.html

方法:

I was looking for something like this but when I follow these steps, I got the root prompt but when I enter passwd <username> command, it says me bash passwd: command not found. It's weird ....:(

hmmmm

maybe the PATH variable is not set
try:
/usr/bin/passwd <uname>

and of course if you have a different /usr partition, then you have to mount it:
mount /dev/sd<XY> /usr

If you set a root password, though, you cannot boot into recovery mode, so, yes, you would use a live CD to reset the password. Probably the easiest thing would be to edit the /etc/shadow file and confirm the admin user is in the admin group and that sudo is working properly

Excellent idea.

OP: boot the LiveCD, mount the root partition and lock the root password by editing the /etc/shadow file.

from something like this
root:$1$xT12LOOLWUT$L<thisisthepassword>qs2/wM4nNIWjNPidn1R/:14396::::::
bin:x:0::::::
daemon:x:0::::::

to
root:!:14396::::::
bin:x:0::::::
daemon:x:0::::::


$1$xT12LOOLWUT$L<thisisthepassword>qs2/w....1R/ is the encrypted password, you have to replace it with "!" to lock the root account.

then you can reboot in recovery mode.

大意就是说将/etc/shadow里面的第一行的Root密码修改成"!"来首先禁用Root, 然后用Grup的还原模式启用Root Shell来修改Root密码 (使用passwd)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值