{"id":26105,"date":"2023-02-20T07:54:12","date_gmt":"2023-02-20T07:54:12","guid":{"rendered":"http:\/\/localhost\/helpold\/?p=26105"},"modified":"2024-12-22T00:02:43","modified_gmt":"2024-12-21T20:32:43","slug":"recovering-the-root-password-in-the-recovery-mode","status":"publish","type":"post","link":"https:\/\/www.arvancloud.ir\/help\/en\/recovering-the-root-password-in-the-recovery-mode\/","title":{"rendered":"Recovering the root password in the Recovery mode"},"content":{"rendered":"<p>If a Linux-based instance is active in the Cloud Computing section and for any reason you have forgotten your user password to sign in to the instance environment, you will be able to recover the root password. To do this, you need to use the\u00a0<strong>Console<\/strong>\u00a0option in \u201c<strong>Cloud Compute\u201d<\/strong>\u00a0-&gt; \u201c<strong>Instances<\/strong><strong>\u201d<\/strong>\u00a0-&gt; \u201c<strong>Action\u201d<\/strong>\u00a0menu.<\/p>\n<p class=\"western\" dir=\"ltr\" align=\"justify\">In this topic, the methods of recovering the root password in operation systems of\u00a0<span lang=\"en\">Ubuntu, CentOS, and Debain are described.<\/span><\/p>\n<h3 class=\"western\" dir=\"ltr\" align=\"left\"><\/h3>\n<h3 class=\"western\" dir=\"ltr\" align=\"left\"><span lang=\"en\"><strong>Ubuntu operating system<\/strong><\/span><\/h3>\n<ol dir=\"ltr\">\n<li>\n<p align=\"justify\"><span lang=\"en\">After selecting the\u00a0<\/span><span lang=\"en\"><strong>console<\/strong><\/span><span lang=\"en\">\u00a0option, as soon as the window opens and before the operating system loads, press\u00a0<\/span><span lang=\"en\"><strong>Shift<\/strong><\/span><span lang=\"en\">\u00a0to move to the\u00a0<\/span><span lang=\"en\"><strong>GNU GRUB<\/strong><\/span><span lang=\"en\"> menu.<br \/>\n<\/span><\/p>\n<\/li>\n<li><span lang=\"en\"><span lang=\"en\">Use the arrow keys on the keyboard to go to\u00a0<strong>Advance options for Ubuntu<\/strong>\u00a0and press\u00a0<strong>Enter<\/strong>\u00a0to move to the next step. In this step, select the second option that ends with\u00a0<strong>recovery mode.<\/strong><\/span><\/span><\/li>\n<li>\n<p align=\"justify\">After few seconds, you will face with a page similar to the image below. Select the\u00a0<strong>root<\/strong> option to move to the next step.<\/p>\n<\/li>\n<li>\n<p align=\"left\">In this step, press\u00a0<strong>Enter<\/strong>\u00a0to enter into the\u00a0<strong>root<\/strong> environment.<\/p>\n<ol dir=\"ltr\" start=\"5\">\n<li>\n<p align=\"left\"><span lang=\"en\">Then, enter the following command:<\/span><\/p>\n<p class=\"western\" dir=\"ltr\" align=\"left\"><code class=\"http\"><span lang=\"en\"><em>mount -o remount,rw \/sysroot\u00a0<\/em><\/span><\/code><\/p>\n<\/li>\n<li>\n<p align=\"justify\"><span lang=\"en\">In the next step, enter the following command and set a new password.<br \/>\n<\/span><\/p>\n<p class=\"western\" dir=\"ltr\" align=\"left\"><code class=\"http\"><span lang=\"en\"><em>passwd root<\/em><\/span><\/code><\/p>\n<\/li>\n<li>\n<p align=\"left\">Finally, reboot the cloudlet by using the\u00a0<strong>reboot<\/strong>\u00a0command.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h3 class=\"western\" dir=\"ltr\" align=\"left\"><strong>Debian operating system<\/strong><\/h3>\n<ol dir=\"ltr\">\n<li>\n<p align=\"left\">After selecting the\u00a0<strong>console\u00a0<\/strong>option from the\u00a0<strong>Operation<\/strong>\u00a0menu, as soon as the window opens and connection is established press\u00a0<strong>e<\/strong>\u00a0to move to the\u00a0<strong>GNU Grab<\/strong>\u00a0menu. Then,\u00a0<span lang=\"en\">using the arrow keys on the keyboard,\u00a0<\/span>move to the line of\u00a0<span lang=\"en\"><strong>inux \/ boot \/ vmlinuz \u2026<\/strong><\/span><span lang=\"en\">\u00a0and\u00a0<\/span><span lang=\"en\"><strong>delete all phrases in this line beginning with console<\/strong><\/span><span lang=\"en\">. In the next step, go to the end of this line and after pressing one\u00a0<\/span><span lang=\"en\"><strong>Space<\/strong><\/span><span lang=\"en\">, add the phrase of\u00a0<\/span><span lang=\"en\"><strong>init=\/bin\/bash<\/strong><\/span><span lang=\"en\">. Finally, press\u00a0<\/span><span lang=\"en\"><strong>Ctrl + X<\/strong><\/span><span lang=\"en\"> to reload the system.<br \/>\n<\/span><\/p>\n<\/li>\n<li>\n<p align=\"justify\"><span lang=\"en\">After the system was booted, you should be transferred to the following environment.<br \/>\n<\/span><\/p>\n<\/li>\n<li>\n<p align=\"justify\">In this environment, the file system is in read-only mode. To be able to create any change in this file, it must be first change to read-write mode. To do this, enter the following command:<\/p>\n<p class=\"western\" dir=\"ltr\" align=\"left\"><em><code>mount -o remount \/<\/code><br \/>\n<\/em><\/p>\n<\/li>\n<li>\n<p align=\"justify\">Now you can change the root password by using the\u00a0<span lang=\"en\"><strong>passwd<\/strong><\/span><span lang=\"en\"> command.<br \/>\n<\/span><\/p>\n<\/li>\n<li>\n<p align=\"justify\">Finally, reboot the system by pressing\u00a0<strong>Alt + Ctrl + Delete\u00a0<\/strong><span lang=\"en\">at the top of the window<\/span>.<\/p>\n<\/li>\n<\/ol>\n<h3 class=\"western\" dir=\"ltr\" align=\"left\"><strong>CentOS operating system<\/strong><\/h3>\n<ol dir=\"ltr\">\n<li>\n<p align=\"justify\">After selecting the\u00a0<strong>Console<\/strong>\u00a0option from the\u00a0<strong>Operation<\/strong>\u00a0menu, when you saw the following options during the boot process, press\u00a0<strong>e<\/strong>\u00a0to move to\u00a0<strong>GNU Grab<\/strong> menu.<\/p>\n<\/li>\n<li>Then, using the arrow keys on the keyboard, move down to arrive at\u00a0<strong>Linux 16<\/strong>\u00a0line.\u00a0<strong>Delete all phrases in this line beginning with console<\/strong>. Change the phrase of\u00a0<strong>ro<\/strong>\u00a0in this line to\u00a0<strong>rw<\/strong>, and add the phrase of\u00a0<strong>break enforcing=0<\/strong>\u00a0to this line. Finally, press\u00a0<strong>Ctrl + X<\/strong> so the system will be reloaded.<\/li>\n<li>In the next step, using the following command, change the file system to read-write mode:\n<p class=\"western\" dir=\"ltr\" align=\"left\"><em><code>mount -o remount,rw \/sysroot<\/code><br \/>\n<\/em><\/p>\n<\/li>\n<li>\n<p align=\"justify\">Change the root file system using the following command:<\/p>\n<p class=\"western\" dir=\"ltr\" align=\"left\"><code><em>chroot \/sysroot<\/em><\/code><\/p>\n<\/li>\n<li>\n<p align=\"justify\">Now, using the\u00a0<strong>passwd<\/strong> command, change the root password and set a new password.<\/p>\n<\/li>\n<li>\n<p align=\"justify\">Then, use the following command to update the content of\u00a0<span lang=\"en\">SELinux (a Linux security module) in accordance with these new settings.<\/span><\/p>\n<p>&nbsp;<\/li>\n<li>\n<p align=\"justify\">Finally, first exit from chroot using the\u00a0<strong>exit<\/strong>\u00a0command. Then, use the\u00a0<strong>exit<\/strong> command again to reboot the system.<\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>If a Linux-based instance is active in the Cloud Computing section and for any reason you have forgotten your user password to sign in to the instance environment, you will be able to recover the root password. To do this, you need to use the\u00a0Console\u00a0option in \u201cCloud Compute\u201d\u00a0-&gt; \u201cInstances\u201d\u00a0-&gt; \u201cAction\u201d\u00a0menu. In this topic, the methods [&hellip;]<\/p>\n","protected":false},"author":79,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"r1_post_views_count":"916","feedback_yes":"0","feedback_no":"0","ads_id_sidebar":"","ads_id_content":"","footnotes":""},"categories":[245,279],"tags":[],"class_list":["post-26105","post","type-post","status-publish","format-standard","hentry","category-cloud-server","category-server-troubleshooting"],"lang":"en","translations":{"en":26105},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/users\/79"}],"replies":[{"embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/comments?post=26105"}],"version-history":[{"count":3,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26105\/revisions"}],"predecessor-version":[{"id":28040,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26105\/revisions\/28040"}],"wp:attachment":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/media?parent=26105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/categories?post=26105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/tags?post=26105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}