{"id":126,"date":"2018-11-27T18:43:26","date_gmt":"2018-11-27T18:43:26","guid":{"rendered":"https:\/\/unsrewiki.1sys1.com\/?p=126"},"modified":"2018-11-27T18:46:35","modified_gmt":"2018-11-27T18:46:35","slug":"recovering-the-root-password","status":"publish","type":"post","link":"https:\/\/server-help.org\/index.php\/2018\/11\/27\/recovering-the-root-password\/","title":{"rendered":"Recovering the Root Password (RHEL \/ CentOS 7)"},"content":{"rendered":"\n<p>This guide will provide you with an information on how to reset lost root ( administrator ) password on RHEL \/ CentOS 7<br><\/p>\n\n\n\n<ul><li>Start or reboot a system to get into the boot menu.<\/li><\/ul>\n\n\n\n<ul><li>Press any key to stop the auto selection of a menu item.<\/li><\/ul>\n\n\n\n<ul><li>Ensure the kernel you intend to boot into is highlighted and press the E key to edit the entry.<\/li><\/ul>\n\n\n\n<ul><li>Navigate to the&#8221;linux16&#8243; kernel line and hit the End key to go to the end of the line.<\/li><\/ul>\n\n\n\n<ul><li>Append&nbsp;<em>rd.break<\/em>&nbsp;to the linux16 kernel line.<\/li><\/ul>\n\n\n\n<ul><li>Hit Ctrl + X to continue.<\/li><\/ul>\n\n\n\n<ul><li>The system boots into an emergency mode that has the <em>\/sysroot<\/em> directory&nbsp;mounted as read only.<\/li><\/ul>\n\n\n\n<ul><li>Mount the <em>\/sysroot<\/em> directory with read and write permissions.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>mount -oremount, rw \/sysroot<\/code><\/pre>\n\n\n\n<ul><li>Switch into <strong>chroot<\/strong> jail and set the <em>\/sysroot<\/em> as the root file system.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>chroot \/sysroot<\/code><\/pre>\n\n\n\n<ul><li>Reset the root password.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>passwd root<\/code><\/pre>\n\n\n\n<ul><li>Cleanup. Make sure that all unlabeled files get&nbsp;relabeled&nbsp;during the boot process for SELinux.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>touch \/.autorelabel <\/code><\/pre>\n\n\n\n<ul><li>Exit chroot jail.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>exit<\/code><\/pre>\n\n\n\n<ul><li>Exit the <strong>initramfs<\/strong> debug shell.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>exit<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This guide will provide you with an information on how to reset lost root ( administrator ) password on RHEL \/ CentOS 7 Start or reboot a system to get into the boot menu. Press any key to stop the auto selection of a menu item. Ensure the kernel you intend to boot into is&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,7],"tags":[],"_links":{"self":[{"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/posts\/126"}],"collection":[{"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":3,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":131,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions\/131"}],"wp:attachment":[{"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server-help.org\/index.php\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}