美文网首页
Linux重置root密码

Linux重置root密码

作者: BarryChan_ | 来源:发表于2019-03-22 17:55 被阅读0次

e进入内核编辑页面;

linux16 参数这行追加rd.break console=tty0, Crtl+X运行,30s进入紧急求援模式

输入命令行

switch root:/# mount -o rw, remount /sysroot#重新挂载root,执行读写

  chrootswitch root:/# chroot /sysroot#chroot目录暂时作为根目录

passwd#密码命令

(echo "新密码"|passwd--stdin root#显示密码输入)

New password:

Retype new password:

完事要继续命令行

sh-4.2#touch /.autorelabel#RAM Disk模式下系统无 SELinux,此命令用于启动自动恢复SELinux安全上下文,关键指令

sh-4.2#exit  #离开

sh-4.2#reboot     #重启

相关文章

网友评论

      本文标题:Linux重置root密码

      本文链接:https://www.haomeiwen.com/subject/eewrvqtx.html