CentOS7.2 忘记root密码解决

前端之家收集整理的这篇文章主要介绍了CentOS7.2 忘记root密码解决前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

CentOS7 root密码的重置方式和CentOS 6完全不一样,以进入单用户模式修改root密码为例。


1.重启开机按esc,在第一行按e,进行编辑

@H_301_20@650) this.width=650;" src="http://img.jb51.cc/vcimg/static/loading.png" alt="" style="border:0px;margin:2px 0px;height:auto;" border="0" src="index_files/d25c350a-7c43-4453-a8b4-7be074388480.png">

wKioL1mhCLPDRSK3AAATZ2TkwlE131.png-wh_50


2.编辑修改两处:ro改为rw,在LANG=en_US.UFT-8后面添加init=/bin/sh

@H_301_20@650) this.width=650;" src="http://img.jb51.cc/vcimg/static/loading.png" alt="" style="border:0px;margin:2px 0px;height:auto;" border="0" src="index_files/11ab5114-0116-4b3d-9377-2ee631c6fc67.png">

wKiom1mhCNyDckafAABSIW8rjTc020.png-wh_50

3.按Ctrl+X重启,并修改密码

wKioL1mhCN2zofj_AAAcseuH5LY751.png-wh_50

@H_301_20@650) this.width=650;" src="http://img.jb51.cc/vcimg/static/loading.png" alt="" style="border:0px;margin:2px 0px;height:auto;" border="0" src="index_files/2324f389-e416-4bdf-857a-7ab353e44726.png">



4.由于selinux开启着的需要执行以下命令更新系统信息,否则重启之后密码未生效

本处关闭selinux

# vi /etc/sysconfig/selinux

wKioL1mhCPCSockNAAAsJzXtAG4958.png-wh_50

@H_301_20@650) this.width=650;" src="http://img.jb51.cc/vcimg/static/loading.png" alt="" style="border:0px;margin:2px 0px;height:auto;" border="0" src="index_files/c53d5999-d5f7-4099-b741-408ce40f2007.png">


5.重启系统

# exec /sbin/init

@H_301_20@650) this.width=650;" src="http://img.jb51.cc/vcimg/static/loading.png" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" border="0" src="http://ywliyq.blog.51cto.come/u261/themes/default/images/spacer.gif">

wKiom1mhCROCsKu0AAAH6LOn3mc974.png-wh_50

猜你在找的CentOS相关文章