centos修改root密码

1.开机时,在选择内核时按e

 

 2.在linux16这行最后输入rd.break console=tty0,进入系统

 

 

 此时进入紧急模式

 3.依次输入

mount -o remount,rw /sysroot

chroot /sysroot

passwd

touch /.autorelabel

 

 修改完后连续输入两次exit即可

 

posted @ 2022-09-21 22:57  L·S  阅读(113)  评论(0)    收藏  举报