centos7

CentOS 7 / RHEL 7 : 重置root密码

星期四, 十一月 26th, 2015 | linux | 没有评论

以前装了centos7的虚拟机为了玩Docker,无奈忘记了当初设置的密码了,网上弄了一圈重置密码信息,记录下.
只知道按e可以进入单个用户模式,无奈centos7启动了grub2模式 要加对应的启动才行

1.第一步重启系统按 e进入编辑模式 GRUB 2

2.第二步 在 rhgb and quiet 的后面添加

init=/bin/sh
selinux=0

root-passwd-2
root-password-3

3.第三步 Remount / root partition , reset root password and autorelable
使用passwd root 修改密码

1
2
mount -o remount, rw /
passwd root

NICE 如图成功:
vbox-6
NOTE: In case system is not writable, the passwd tool fails with the following error:
Authentication token manipulation error

Now run the below given command for relabeling the SELINUX
› Continue reading

Tags: , ,

Search

文章分类

Links

Meta