linux重置密码

2022-12-15,,

方法一:

进入grub菜单界面

按e键 在linux开头的行按ctrl+e 或者end跳到行尾,输入rd.break

按ctrl+x

mount -o remount,rw /sysroot

chroot /sysroot

passwd root

输入两次密码

touch /.autorelabel #selinux开启需要打标签,如果selinux未开启,可以忽略此步

exit

reboot

方法二:

进入grub菜单界面

按e键 在linux开头的行找到ro 改为rw init=/sysroot/bin/bash

按ctrl+x

chroot /sysroot

passwd root

输入两次密码

touch /.autorelabel #selinux开启需要打标签,如果selinux未开启,可以忽略此步

exit

reboot

linux重置密码的相关教程结束。

《linux重置密码.doc》

下载本文的Word格式文档,以方便收藏与打印。