Linux企业运维实战
丁敏 郑国华

1
2
3
4
5
6
7
8
9
10
11
12
13

任务2-重置root管理员密码

发布时间:2022-02-19 07:54   发布人:丁敏   浏览次数:401

1.开机后在选择菜单时按下e进入编辑模式

2.选择linux16这一行,在行末尾添加 rd.break

 

3.然后Ctrl x执行。然后进入shell界面:

 

4.设置密码:

  1.重新挂载根目录为读写模式 mount -o remount, rw /sysroot

  

mount -o remount, rw /sysroot

 

 

 

  

 

  2.切换到系统真正的根目录下:chroot  /sysroot

chroot  /sysroot

  

  3.修改密码 passwd root

 passwd root

  

  4.创建文件标签.autorelabel : touch /.autorelabel

touch /.autorelabel

  5.退出编辑模式,exit(2次)

系统自动重启,使用新密码重新登录