1>.破解CentOS7 的root口令方法一
启动时任意键暂停启动
按e键进入编辑模式
将光标移动到linux16开始的行,添加内核参数rd.break
按Ctrl-x启动
mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel
exit
启动时任意键暂停启动
按e键进入编辑模式
将光标移动到linux16开始的行,改为rw init=/sysroot/bin/sh
按Ctrl-x启动
chroot /sysroot
passwd root
touch /.autorelabel # (如果你系统没有开启selinux,那么可以不做这一步)
exit
reboot
备注:1. touch /.autorelabel 因为在此情況下,SELinux 並沒有启动,对所有文件的更改,可能会造成文档的context(安全上下文)不正确,为确保开机时重新设定SELinux context,必須在根目录下添加隐藏文件.autorelabel。
启动时任意键暂停启动
按e键进入编辑模式
将光标移动到linux16开始的行,添加内核参数rd.break
按Ctrl-x启动
mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel
exit
reboot
启动时任意键暂停启动
按e键进入编辑模式
将光标移动到linux16开始的行,改为rw init=/sysroot/bin/sh
按Ctrl-x启动
chroot /sysroot
passwd root
touch /.autorelabel # (如果你系统没有开启selinux,那么可以不做这一步)
exit
reboot
备注:1. touch /.autorelabel 因为在此情況下,SELinux 並沒有启动,对所有文件的更改,可能会造成文档的context(安全上下文)不正确,为确保开机时重新设定SELinux context,必須在根目录下添加隐藏文件.autorelabel。