GNU/Linux for Debian忘记root密码的解决方法

前段时间忙着搞其他的电脑,冷落了这台Debian,现在可好root密码也记不得了:
1.grub选项下选择您要进入的条目 "Debian GNU/Linux, kernel ...",e进入编辑模式
2.在第二行,编辑 "kernel  /boot/vmlinuz ...",e进入编辑模式
3.在句末加上”init=/bin/bash”,回车
4.“b”启动系统,这样我们即可获得一个bashshell.进入shell后,根分区的挂载模式默认是只读,
我们要将其改为可写,否则不能更改root密码,进入后执行下列指令:

#Su -
[email=root@(none]root@(none[/email]
)# mount -no remount,rw /
[email=root@(none]root@(none[/email]
)# mount -a
[email=root@(none]root@(none[/email]
)# passwd root
[email=root@(none]root@(none[/email]
)# reboot
哈哈,搞定,打完收工!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值