{"id":670,"date":"2020-09-24T13:31:37","date_gmt":"2020-09-24T07:31:37","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=670"},"modified":"2020-09-24T13:31:37","modified_gmt":"2020-09-24T07:31:37","slug":"how-to-reset-root-password-in-centos-7","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-reset-root-password-in-centos-7.html","title":{"rendered":"How to reset root password in CentOS 7"},"content":{"rendered":"\n<p>Resetting admin password in CentOS 7 is different than of CentOS 6, as CentOS 7 utilized Grub 2 and has a different procedure to access Single User Mode. First, boot your system in Single User Mode to reset the root password by following the below tutorial:<\/p>\n\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-mellowhost-blog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"35390CwkCU\"><a href=\"https:\/\/mellowhost.com\/blog\/how-to-boot-centos-7-in-single-user-mode.html\">How to boot CentOS 7 in Single User Mode<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;How to boot CentOS 7 in Single User Mode&#8221; &#8212; Mellowhost Blog\" src=\"https:\/\/mellowhost.com\/blog\/how-to-boot-centos-7-in-single-user-mode.html\/embed#?secret=35390CwkCU\" data-secret=\"35390CwkCU\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Once done, now, you may first chroot the system:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">chroot \/sysroot<\/pre>\n\n\n\n<p>Now, you may reset the password using the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">passwd root<\/pre>\n\n\n\n<p>You should be done. If you are using SELinux, then you need to relabel accordingly:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">touch \/.autorelabel<\/pre>\n\n\n\n<p>Then, exit chroot and reboot the system:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">exit &amp;&amp; reboot<\/pre>\n\n\n\n<p>You should be done now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Resetting admin password in CentOS 7 is different than of CentOS 6, as CentOS 7 utilized Grub 2 and has a different procedure to access Single User Mode. First, boot your system in Single User Mode to reset the root password by following the below tutorial: Once done, now, you may first chroot the system: &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-reset-root-password-in-centos-7.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to reset root password in CentOS 7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[295,12],"tags":[220,498,499,496],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/670"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=670"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/670\/revisions"}],"predecessor-version":[{"id":671,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/670\/revisions\/671"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}