Resetting the Root Password Using rd.break for RHEL7
- Start the system and, on the GRUB 2 boot screen, press the e key for edit.
- Remove the rhgb and quiet parameters from the end, or near the end, of the linux16 line, or linuxefi on UEFI systems.
Press Ctrl+a and Ctrl+e to jump to the start and end of the line, respectively. On some systems, Home and End might also work.
IMPORTANT
The rhgb and quiet parameters must be removed in order to enable system messages.
- Add the following parameters at the end of the linux line on 64-Bit IBM Power Series, the linux16 line on x86-64 BIOS-based systems, or the linuxefi line on UEFI systems:
rd.break enforcing=0
Adding the enforcing=0 option enables omitting the time consuming SELinux relabeling process.
The initramfs will stop before passing control to the Linux kernel, enabling you to work with the root file system.
Note that the initramfs prompt will appear on the last console specified on the Linux line
- Press Ctrl+x to boot the system with the changed parameters.
With an encrypted file system, a password is required at this point. However the password prompt might not appear as it is obscured by logging messages. You can press the Backspace key to see the prompt. Release the key and enter the password for the encrypted file system, while ignoring the logging messages.
The initramfs switch_root prompt appears.
- The file system is mounted read-only on /sysroot/. You will not be allowed to change the password if the file system is not writable.
Remount the file system as writable:
switch_root:/# mount –o remount,rw /sysroot
- The file system is remounted with write enabled. Change the file system's root as follows:
switch_root:/# chroot /sysroot
The prompt changes to sh-4.2#.
- Enter the passwd command and follow the instructions displayed on the command line to change the root password.
Note that if the system is not writable, the passwd tool fails with the following error:
Authentication token manipulation error
- Updating the password file results in a file with the incorrect SELinux security context. To relabel all files on next system boot, enter the following command:
sh-4.2# touch /.autorelabel
Alternatively, to save the time it takes to relabel a large disk, you can omit this step provided you included the enforcing=0 option in step 3.
- Remount the file system as read only:
sh-4.2# mount –o remount,ro /
- Enter the exit command to exit the chroot environment
- Enter the exit command again to resume the initialization and finish the system boot.s
With an encrypted file system, a password or phrase is required at this point. However the password prompt might not appear as it is obscured by logging messages. You can press and hold the Backspace key to see the prompt. Release the key and enter the password for the encrypted file system, while ignoring the logging messages.
NOTE
Note that the SELinux relabeling process can take a long time. A system reboot will occur automatically when the process is complete.
- If you added the enforcing=0 option in step 3 and omitted the touch /.autorelabel command in step 8, enter the following command to restore the /etc/shadow file's SELinux security context:
# restorecon /etc/shadow
Enter the following commands to turn SELinux policy enforcement back on and verify that it is on:
# setenforce 1
# getenforce
Enforcing
Resetting the Root Password Using rd.break for RHEL7的更多相关文章
- mysql forget root password
http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password MySQL - ...
- Linux - Reset a MySQL root password
Use the following steps to reset a MySQL root password by using the command line interface. Stop the ...
- MYSQL更改root password时遇到Access Denied的解决办法
今天在公司虚拟机上装MYSQL之后需要修改root password,然而遇到这样的错误: Access denied for user 'root'@'localhost' (using passw ...
- mysqladmin -u root password
ERROR : Error appeared during Puppet run: 192.77.108.242_mysql.ppError: mysqladmin -u root password ...
- MYSQL安装时解决要输入current root password的解决方法
在装MYSQL的时候发现要输入current root password不记得以前在电脑里装过(你的系统曾经装过MYSQL在重装就会要求输入原来设定的密码,如果是第一次安装就不会出现),在网上苦苦搜寻 ...
- centos7开机出现try again to boot into default maintenance give root password for maintenance
开启centos7出现下面两句话,然后直接输出root密码,就可以登录,但是登录后,发现一些文字显示出来的是乱码 try again to boot into default maintenanceg ...
- linux系统无法启动,提示give root password for maintenance错误
电脑的虚拟机安装的是centos6.2操作系统,今天打开虚拟机时候,提示 give root password for maintenance (or type control-D to contin ...
- linux开机出现Give root password for maintenance (or type Control-D to continue):解决办法
修改rc.local后导致 linux开机出现Give root password for maintenance,而且很多系统文件无法修改,之前的rc.local也不能修改了,单用户模式也无法进入 ...
- Give root password for maintenance
linux开机出现"Give root password for maintenance (or type Control-D to continue):" 出现这种情况一般为两种 ...
随机推荐
- Percona 工具 pt-query-digest的使用
pt-query-digest说明 pt-query-digest 用来格式化分析MySQL产生的日志,如:慢查询日志.二进制日志.通用日志,根据不同的条件进行分析并生成报告. pt-query-di ...
- django-xhtml2pdf的使用(加入图片,指定字体,设置样式)
新博客地址:http://muker.net/django-xhtml2pdf.html 这里仅仅讨论直接利用html生成pdf这种最常见也最简单的情况. 1.要利用html生成带中文的pdf要指定中 ...
- erl_0015 《硝烟中的erlang》 读书笔记002 “为过载做计划”
为过载做计划 到目前为止,我在实际工作中所碰到最常见的错误,基本上都是节点内存耗尽.而且通常都和过长的消息队列有关37.解决这类问题的方法有很多,不过只有在深入.全面的理解系统后,才能做出正确的选择. ...
- HihoCoder 1063 : 缩地 树形DP第二题(对象 边)
时间限制:12000ms 单点时限:1000ms 内存限制:256MB 描述 编织者是 Dota 系列中的一个伪核,拥有很强的生存能力和线上消耗能力.编织者的代表性技能是缩地.缩地带来的隐身.极限移动 ...
- BZOJ1563 NOI2009 诗人小G【决策单调性优化DP】
LINK 因为是图片题就懒得挂了 简要题意:有n个串,拼接两个串需要加一个空格,给你l和p,问你拼接后每个串的总长减l的绝对值的p次方的最小值 首先打表发现一下这题是决策单调的对于所有数据都成立就当他 ...
- BZOJ1878 SDOI2009 HH的项链 【莫队】
BZOJ1878 SDOI2009 HH的项链 Description HH有一串由各种漂亮的贝壳组成的项链.HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一段贝壳,思考它们所表达的 ...
- .NET Standard / dotnet-core / net472 —— .NET 究竟应该如何大小写?
本文将解释在 .NET 技术栈中各种不同使用方式下 N E T 三个字母何时大写何时小写:前面的 “.” 什么时候加上,什么时候去掉,什么时候又使用 “dot”. .NET 在技术文档中 如果你阅 ...
- Maven系列(一)之初识Maven
Maven是个啥? Maven主要服务于基于Java平台的项目构建.依赖管理和项目信息管理,并且Maven是跨平台的,这意味着无论是在Windows上,还是在Linux或者Mac上,都可以使用同样的命 ...
- Linux下Eclipse配置安装 PyDev(Pydev插件一直不能成功,安装这个插件失败的问题)
pydev插件安装方式如果采取从网络上下载,然后解压到eclipse中文件夹到方式,运行到时候可能会导致重启eclipse后根本看不到这个插件! 原因以及解决方式,看下面! 转自:http://ww ...
- SQL夯实基础(九)MySQL联接查询算法
书接上文<SQL夯实基础(八):联接运算符算法归类>. 这里先解释下EXPLAIN 结果中,第一行出现的表就是驱动表(Important!). 对驱动表可以直接排序,对非驱动表(的字段排序 ...