重置Centos 7 Root密碼的方式和Centos 6完全不同。讓我來展示一下到底如何操作。
1 – 在啓動grub菜單,選擇編輯選項啓動
2 – 按鍵盤e鍵,來進入編輯界面
3 – 找到Linux 16的那一行,將ro改爲rw init=/sysroot/bin/sh
4 – 現在按下 Control+x ,使用單用戶模式啓動
5 – 現在,可以使用下面的命令訪問系統
chroot /sysroot
# 換根
6 – 重置密碼
passwd root
7 – 更新系統信息
touch /.autorelabel
8 – 退出chroot
exit
9 – 重啓你的系統
reboot
就是這樣!