{"id":7396,"date":"2025-03-18T10:24:13","date_gmt":"2025-03-18T10:24:13","guid":{"rendered":"https:\/\/natsav.com\/blog\/?p=7396"},"modified":"2025-03-18T10:24:20","modified_gmt":"2025-03-18T10:24:20","slug":"how-to-reset-the-root-password-in-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/natsav.com\/blog\/how-to-reset-the-root-password-in-ubuntu-22-04\/","title":{"rendered":"How to reset the root password in Ubuntu 22.04"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_68_1 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/natsav.com\/blog\/how-to-reset-the-root-password-in-ubuntu-22-04\/#Introduction\" title=\"Introduction\">Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/natsav.com\/blog\/how-to-reset-the-root-password-in-ubuntu-22-04\/#Access_the_KVM_Console\" title=\"Access the KVM Console\">Access the KVM Console<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/natsav.com\/blog\/how-to-reset-the-root-password-in-ubuntu-22-04\/#2_Reboot_the_machine\" title=\"2. Reboot the machine\">2. Reboot the machine<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/natsav.com\/blog\/how-to-reset-the-root-password-in-ubuntu-22-04\/#3Modify_GRUB_Boot_Parameters\" title=\"3.Modify GRUB Boot Parameters\">3.Modify GRUB Boot Parameters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/natsav.com\/blog\/how-to-reset-the-root-password-in-ubuntu-22-04\/#4Gain_Root_Shell_Access_Without_a_Password\" title=\"4.Gain Root Shell Access Without a Password\">4.Gain Root Shell Access Without a Password<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/natsav.com\/blog\/how-to-reset-the-root-password-in-ubuntu-22-04\/#5Reset_Root_and_User_Passwords\" title=\"5.Reset Root and User Passwords\">5.Reset Root and User Passwords<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Introduction\"><\/span>Introduction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we will walk you through the steps to reset a forgotten root user password on the Ubuntu 22.04<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Access_the_KVM_Console\"><\/span>Access the KVM Console<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In order to change the root password you will need to log into the KVM console, depending on which server type you are using the methods may differ:<\/p>\n\n\n\n<p>Under the VPS service details page click onto the button Console. Now you should have the KVM console open in a new browser<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"332\" src=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image-1.png?resize=700%2C332&#038;ssl=1\" alt=\"\" class=\"wp-image-7415\" style=\"width:782px;height:auto\" srcset=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image-1.png?w=700&amp;ssl=1 700w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image-1.png?resize=300%2C142&amp;ssl=1 300w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image-1.png?resize=150%2C71&amp;ssl=1 150w\" sizes=\"(max-width: 700px) 100vw, 700px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Reboot_the_machine\"><\/span>2. Reboot the machine<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>With the KVM console open, reboot the server to access the GRUB menu.<br>\u26a1 <strong>Note:<\/strong> After rebooting, quickly switch to the KVM console, as the GRUB menu is available for only a few seconds before automatically booting the operating system.<\/p>\n\n\n\n<p>For Cloud VPS: Open the service details page and click Reboot.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"332\" src=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image_new-1.png?resize=700%2C332&#038;ssl=1\" alt=\"\" class=\"wp-image-7416\" style=\"width:731px;height:auto\" srcset=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image_new-1.png?w=700&amp;ssl=1 700w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image_new-1.png?resize=300%2C142&amp;ssl=1 300w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image_new-1.png?resize=150%2C71&amp;ssl=1 150w\" sizes=\"(max-width: 700px) 100vw, 700px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p><br>For Dedicated Server: \u00a0<strong>Server power control<\/strong>\u00a0>\u00a0<strong>Reboot<\/strong> to reboot the server.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"332\" src=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image_latest-1.png?resize=700%2C332&#038;ssl=1\" alt=\"\" class=\"wp-image-7417\" style=\"width:722px;height:auto\" srcset=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image_latest-1.png?w=700&amp;ssl=1 700w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image_latest-1.png?resize=300%2C142&amp;ssl=1 300w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/enhanced_image_latest-1.png?resize=150%2C71&amp;ssl=1 150w\" sizes=\"(max-width: 700px) 100vw, 700px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3Modify_GRUB_Boot_Parameters\"><\/span>3.Modify GRUB Boot Parameters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once the server reboots:<\/p>\n\n\n\n<ul>\n<li>Quickly press the <strong>ESC<\/strong> key to bring up the GRUB menu. If you miss it, reboot the server again.<\/li>\n\n\n\n<li>In the GRUB menu, press <strong>E<\/strong> to modify boot parameters.<\/li>\n\n\n\n<li>On the next screen, use the arrow keys to navigate down to the line that contains<br>\u201c<strong><code>ro\u00a0 quiet splash $vt_handoff<\/code><\/strong>\u201d<br>       <\/li>\n\n\n\n<li>Now&nbsp;<strong>delete<\/strong>&nbsp;and&nbsp;<strong>replace<\/strong>&nbsp;that with,&nbsp;<strong><code>rw init=\/bin\/bash<\/code>&nbsp;<\/strong>as shown in the below screenshot<\/li>\n\n\n\n<li>Press <strong>CTRL + X<\/strong> or <strong>F10<\/strong> to boot into single-user mode.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-15.png?resize=640%2C480&#038;ssl=1\" alt=\"\" class=\"wp-image-7419\" style=\"width:697px;height:auto\" srcset=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-15.png?w=640&amp;ssl=1 640w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-15.png?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-15.png?resize=150%2C113&amp;ssl=1 150w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4Gain_Root_Shell_Access_Without_a_Password\"><\/span>4.Gain Root Shell Access Without a Password<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>After making the changes, Ubuntu 22.04 will boot into a shell with root privileges.<br>To ensure you have root access with read and write permissions, run the following command:<br>mount | grep -w \/<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"53\" src=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-17.png?resize=654%2C53&#038;ssl=1\" alt=\"\" class=\"wp-image-7421\" srcset=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-17.png?w=654&amp;ssl=1 654w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-17.png?resize=300%2C24&amp;ssl=1 300w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-17.png?resize=640%2C53&amp;ssl=1 640w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-17.png?resize=150%2C12&amp;ssl=1 150w\" sizes=\"(max-width: 654px) 100vw, 654px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>You should see an output similar to:<br> \/dev\/sda5 on \/ type ext4 (rw, realtime)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"50\" src=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-18.png?resize=668%2C50&#038;ssl=1\" alt=\"\" class=\"wp-image-7422\" srcset=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-18.png?w=668&amp;ssl=1 668w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-18.png?resize=300%2C22&amp;ssl=1 300w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-18.png?resize=150%2C11&amp;ssl=1 150w\" sizes=\"(max-width: 668px) 100vw, 668px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>The <strong>rw<\/strong> indicates that you have read and write permission<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5Reset_Root_and_User_Passwords\"><\/span>5.Reset Root and User Passwords<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To reset the root password, simply run:<br><strong>passwd<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"52\" src=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-19.png?resize=649%2C52&#038;ssl=1\" alt=\"\" class=\"wp-image-7423\" style=\"width:683px;height:auto\" srcset=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-19.png?w=649&amp;ssl=1 649w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-19.png?resize=300%2C24&amp;ssl=1 300w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-19.png?resize=640%2C52&amp;ssl=1 640w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-19.png?resize=150%2C12&amp;ssl=1 150w\" sizes=\"(max-width: 649px) 100vw, 649px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"573\" height=\"194\" src=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-20.png?resize=573%2C194&#038;ssl=1\" alt=\"\" class=\"wp-image-7424\" style=\"width:688px;height:auto\" srcset=\"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-20.png?w=573&amp;ssl=1 573w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-20.png?resize=300%2C102&amp;ssl=1 300w, https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2025\/03\/image-20.png?resize=150%2C51&amp;ssl=1 150w\" sizes=\"(max-width: 573px) 100vw, 573px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Enter the new password twice when prompted, and your root password will be successfully reset.<br><br><\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this article, we will walk you through the steps to reset a forgotten root user password on the Ubuntu 22.04 Access the KVM Console In order to change the root password you will need to log into the KVM console, depending on which server type you are using the methods may differ: Under [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/7396"}],"collection":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/comments?post=7396"}],"version-history":[{"count":2,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/7396\/revisions"}],"predecessor-version":[{"id":7429,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/7396\/revisions\/7429"}],"wp:attachment":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/media?parent=7396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/categories?post=7396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/tags?post=7396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}