TranslateProject/published/201410/20140926 How To Reset Root Password On CentOS 7.md
2014-11-01 21:03:29 +08:00

53 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

如何重置CentOS 7的Root密码
===
重置Centos 7 Root密码的方式和Centos 6完全不同。让我来展示一下到底如何操作。
1 - 在启动grub菜单选择编辑选项启动
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/09/Selection_003.png)
2 - 按键盘e键来进入编辑界面
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/09/Selection_005.png)
3 - 找到Linux 16的那一行将ro改为rw init=/sysroot/bin/
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/09/Selection_006.png)
4 - 现在按下 Control+x ,使用单用户模式启动
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/09/Selection_007.png)
5 - 现在,可以使用下面的命令访问系统
chroot /sysroot
6 - 重置密码
passwd root
7 - 更新系统信息
touch /.autorelabel
8 - 退出chroot
exit
9 - 重启你的系统
reboot
就是这样!
---
via: http://www.unixmen.com/reset-root-password-centos-7/
作者M.el Khamlichi
译者:[su-kaiyao](https://github.com/su-kaiyao)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出