centos linux忘记密码进行重置

1.重启系统,进入 recovery 恢复模式

在读秒时候按e键,找到 linux16 行,按键盘End

末尾添加空格 rd.break console=tty0

ctrl + x 启动

2.以可写方式重新挂载 /sysroot,并切换到此环境

switch_root# mount  -o  remount,rw  /sysroot

switch_root# chroot  /sysroot

sh-3.2#

3. 将root用户的密码设置为 redhat

# echo  redhat  |  passwd  --stdin  root

)重设SELinux安全标签(安全增强版Linux)

# touch  /.autorelabel            //让  SElinux  失忆

# exit
switch_root# reboot 完成修复
原创文章 223 获赞 57 访问量 12万+

猜你喜欢

转载自blog.csdn.net/xixihahalelehehe/article/details/105746227