1.13-1.16学习笔记

1.13 单用户模式
1、忘记root的密码怎么办
a、重启linux
reboot / init 6/ shutdown -r now
关机 init 0 /poweroff

1 make the command "init 6” to reboot the Centos system,and then click Centos, click button “e" to modify the grub mode
2 change ro to rw, add “init= /sysroot/bin/sh"

see image as below

2 chroot 命令用来在指定的根目录下运行指令。chroot,即change root directory(更改root目录)。在Linux系统中,系统默认的目录结构都是以/,即是以根(root)开始的。而在使用chroot之后,系统的目录结构将以指定的位置作为/位置
chroot /sysroot/

see image as below

3 passwd root
exit blank as below is
1.13-1.16学习笔记
使用LANG = en 密码出现乱码,需要把语言调整英文

在登录系统之前,必须完成这条命令,否则没办法登录系统
touch / .autorelabel

猜你喜欢

转载自blog.51cto.com/12613274/2146834