{"id":5624,"date":"2016-04-05T20:04:35","date_gmt":"2016-04-05T12:04:35","guid":{"rendered":"http:\/\/rmohan.com\/?p=5624"},"modified":"2016-04-05T20:04:35","modified_gmt":"2016-04-05T12:04:35","slug":"rhel7-root-user-password-cracking","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5624","title":{"rendered":"rhel7 root user password cracking"},"content":{"rendered":"<p>Edit current kernel version into the grub menu bar, and finally add rd.break parameters linux6<\/p>\n<p>linux16 \/vmlinuz-3.10.0-327.el7.x86_64 root=\/dev\/mapper\/rhel-root ro rd.lvm.lv=rhel\/root rd.lvm.lv=rhel\/swap rhgb quiet rd.break<br \/>\nUse ctrl + x to reboot the system to start<\/p>\n<p>Remount the &#8216;root&#8217; file system, and change into the \/ sysroot<\/p>\n<p>mount -oremount,rw \/sysroot<br \/>\nchroot \/sysroot<br \/>\nChanging the root password<\/p>\n<p>echo &#8220;RedHat&#8221; | passwd &#8211;stdin root<br \/>\nCreate \/.autorelabel file, skip selinux certification<\/p>\n<p>touch \/.autorelabel<br \/>\ngrub configuration file encryption<br \/>\nUse grub2-mkpasswd-pbkdf2 command to add grub secret key authentication.<\/p>\n<p>[root@rmohan ~]# grub2-mkpasswd-pbkdf2<br \/>\nEnter password:<br \/>\nReenter password:<br \/>\nPBKDF2 hash of your password is grub.pbkdf2.sha512.10000.02A9678D83F863EFAEAAD08E9280D74B5D559577A4D3B6sad52C633053315266B5E883B626413664CAA835A7CDD2A5239ED6CB82D7AEA74127143685E9081E463C652C633053315266B5E883B626413664CAA835A7CDD2A5239ED6CB82D7AEA74127143685E9081E463C6.F49B8110AF0D29B0BE98322D5911824BC9F9DBB4204F71699519484FD288FDF92B58588A108AFE79479F1DB35EE60C144226DE3127F3CBBC68988786AAC69379<br \/>\nEdit \/etc\/grub.d\/00_header the file add. Note that the user may not be present in the root system.<\/p>\n<p>cat &lt;&lt; EOF<br \/>\nset superusers=&#8221;root&#8221;<br \/>\npassword_pbkdf2 rootgrub.pbkdf2.sha512.10000.02A9678D83F863EFAEAAD08E9280D74B5D559577A4D3B652C633053315266B5E883B626413664CAA835A7CDD2A5239ED6CB82D7AEA74127143685E9081E463C6.F49B8110AF0D29B0BE98322D5911824BC9F9DBB4204F71699519484FD288FDF92B58588A108AFE79479F1DB35EE60C144226DE3127F3CBBC68988786AAC69379<br \/>\nEOF<br \/>\nUpdate the grub configuration file to take effect<\/p>\n<p>grub2-mkconfig &gt;&gt; \/boot\/grub2\/grub.cfg<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Edit current kernel version into the grub menu bar, and finally add rd.break parameters linux6<\/p>\n<p>linux16 \/vmlinuz-3.10.0-327.el7.x86_64 root=\/dev\/mapper\/rhel-root ro rd.lvm.lv=rhel\/root rd.lvm.lv=rhel\/swap rhgb quiet rd.break Use ctrl + x to reboot the system to start<\/p>\n<p>Remount the &#8216;root&#8217; file system, and change into the \/ sysroot<\/p>\n<p>mount -oremount,rw \/sysroot chroot \/sysroot Changing the root password<\/p>\n<p>echo [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5624"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5624"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5624\/revisions"}],"predecessor-version":[{"id":5625,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5624\/revisions\/5625"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}