Linux单用户修改密码
前提
linux版本3.10.0+
grub启动模式
操作步骤
- 启动界面进入grub菜单时按下
e - 在linux16一行最后添加上
init=/sysroot/bin/sh - 按下
ctrl+x - 启动后执行
mount -o remount,rw /sysroot - 执行
chroot /sysroot - 执行
passwd root - 按下
Ctrl+D - 执行
reboot重启
linux版本3.10.0+
grub启动模式
e
init=/sysroot/bin/sh
ctrl+x
mount -o remount,rw /sysroot
chroot /sysroot
passwd root
Ctrl+D
reboot重启