Check that you are root
whoami
Check that the root partition is mounted read-write
cat /proc/mounts
If you see that your partition is mounted as ro (read-only), try remounting it as rw
mount -o remount,rw /
好久不用Elementary OS系统了,结果今天一登录,发现用户密码和root密码都忘记了,不过root当时应该是没有设置密码,所以今天能够重置密码成功。
1.在进入开机选择系统界面前,按ESC 或者 SHIFT 键,保证进入GRUB界面。
2.选择OS的高级选项,选择进入恢复模式(选择进入Recovery)
3.可以获得一个bash的shell,进入shell后,尝试passwd huang(huang是我的用户名) ,此时即使输入了unix重置密码,最后还是会出现unchange
系统提示是无法更改read-only文件:etc/shadow等
4.此时更改文件只可读属性就可以了,解决方案如下(方案来自Stack Overflow):
|
Check that you are root
Check that the root partition is mounted read-write
If you see that your partition is mounted as ro (read-only), try remounting it as rw
|
6.重置密码后reboot,这时候就可以使用新的密码进入系统了。