{"id":23997,"date":"2024-01-30T19:28:51","date_gmt":"2024-01-30T19:28:51","guid":{"rendered":"https:\/\/linuxways.net\/?p=23997"},"modified":"2024-03-25T02:10:27","modified_gmt":"2024-03-25T02:10:27","slug":"boot-single-user-mode-centosrhel-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/boot-single-user-mode-centosrhel-8\/","title":{"rendered":"How to Boot into a Single User Mode in CentOS\/RHEL 8"},"content":{"rendered":"<div id=\"wpbody\">\nThe single user mode is also known as emergency mode or maintenance mode which is an important feature in the Linux system management. This mode allows a single user which is often the root user to operate a Linux system. This mode makes it suitable to perform a critical system operations and repairs.<\/p>\n<p>Let us explain about the single user mode in this article. We will also explain how we can easily boot into a single user mode in CentOS\/RHEL 8 using two methods.<\/p>\n<h2><strong>Definition of a Single User Mode in the Linux System<\/strong><\/h2>\n<p>The single user mode is a critical operating state that is used for system recovery and maintenance in a Linux system. This mode is very effective for resolving the serious system issues that cannot be resolved in a multi-user environment.<\/p>\n<p>The system mounts all local file systems, ensuring that the critical resources are available for troubleshooting activities in this single user mode. Furthermore, since the network interfaces remain deactivated in this mode, this mode results in a secure and isolated environment.<\/p>\n<p>This operational state is especially useful for operations like restoring the faulty file systems with tools like \u201cfsck\u201d, resetting a lost root password, correcting the mistakes in the \u201cfstab\u201d file, and disabling\/enabling the systemctl services that may interrupt the system functionality. The single user mode gives the system administrators with a secure and controlled environment in which to troubleshoot the problems and maintain the integrity and operation of a Linux system.<\/p>\n<h2><strong>Use \u201cRd.Break\u201d to Boot into a Single User Mode in CentOS\/RHEL 8<\/strong><\/h2>\n<p>This method offers a straightforward way to access the single user mode in CentOS\/RHEL 8. Here are the steps to follow:<\/p>\n<ul>\n<li>At first, we need to reboot our CentOS\/RHEL 8 system. Then, at the boot menu, we need to select the GRUB menu. We need to press the \u201ce\u201d key to edit the selected kernel.<\/li>\n<li>Then, locate the line that contains &#8220;linux&#8221; and add a keywork called \u201crd.break\u201d at the end of this line. This means that we want to start the single user mode in the CentOS\/RHEL 8 system.<\/li>\n<li>After adding the &#8220;rd.break&#8221; keyword, we need to press &#8220;Ctrl-x&#8221; to boot the system into a single user mode. The system will boot, and we will find ourselves at the single user mode prompt.<\/li>\n<li>Then, we need to remount the \u201c\/sysroot\u201d file system for read and write mode. We can type the following commands to perform this:<\/li>\n<\/ul>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">switch_root:<span class=\"sy0\">\/<\/span><span class=\"co0\"># mount -o remount, rw \/sysroot<\/span><br \/>\nswitch_root:<span class=\"sy0\">\/<\/span><span class=\"co0\"># chroot \/sysroot<\/span><br \/>\n<span class=\"co4\">sh-4.4#<\/span><\/div><\/div>\n<ul>\n<li>If we now want to change our password, we can type the following commands:<\/li>\n<\/ul>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">sh-4.4# <\/span><span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;p@p@n#44 | passwd --stdin root<br \/>\nsh-4.4# touch \/.autorelabel<\/span><\/div><\/div>\n<ul>\n<li>After we have done our tasks, we need to reboot the system by running the following command:<\/li>\n<\/ul>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">sh-4.4# <\/span>reboot <span class=\"re5\">-f<\/span><\/div><\/div>\n<p>This command causes a reboot of the system.<\/p>\n<h2><strong>Replace \u201cRhgb Quiet\u201d to Boot CentOS\/RHEL 8 in a Single User Mode<\/strong><\/h2>\n<p>Another method to boot the CentOS\/RHEL 7\/8 systems into a single user mode involves replacing the &#8220;rhgb quiet&#8221; parameter with &#8220;init=\/bin\/bash&#8221; or &#8220;init=\/bin\/sh&#8221; in the kernel line. Follow these steps:<\/p>\n<ul>\n<li>Start a system reboot and reach the GRUB menu. Then, we need to press the &#8220;e&#8221; key when you see the GRUB menu to enter the editing mode.<\/li>\n<li>After that, we need to locate the line that starts with &#8220;linux&#8221;. Then, go to the last line.<\/li>\n<li>At the end of the line, replace the &#8220;rhgb quiet&#8221; parameter with either &#8220;init=\/bin\/bash&#8221; or &#8220;init=\/bin\/sh&#8221;.<\/li>\n<li>Press &#8220;Ctrl+x&#8221; to boot into a single user mode. The system now starts in this maintenance state.<\/li>\n<li>Then, we need to remount the root filesystem with the write permissions using the following command:<\/li>\n<\/ul>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">mount<\/span> <span class=\"re5\">-o<\/span> remount, rw <span class=\"sy0\">\/<\/span><\/div><\/div>\n<p>This allows us to perform the various maintenance and repair tasks. With an access to the single user mode in CentOS\/RHEL 8, we can solve the issues, make configuration changes, reset the passwords, and resolve the filesystem errors.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>By understanding this article, we must be able to boot into a single user mode on CentOS\/RHEL 8. It offers a secure environment for troubleshooting and maintenance operations such as password recovery and filesystem repairs. The &#8220;rd.break&#8221; and \u201cinit=\/bin\/bash\u201d techniques reduce this procedure and allow the critical tasks to be completed rapidly and securely.\n<\/p><\/div>","protected":false},"excerpt":{"rendered":"<p>Tutorial on the methods of easily booting into a single user mode in CentOS\/RHEL 8 using the &#8220;rd.break&#8221; and \u201cinit=\/bin\/bash\u201d techniques along with examples.<\/p>","protected":false},"author":110,"featured_media":23999,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-23997","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/23997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=23997"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/23997\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/23999"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=23997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=23997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=23997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}