Home > Hosting > Server

How to reset the remote password of a Linux cloud server

2023-06-30 14:41:12

<p><br/></p><p>The knowledge points of this article on how to reset the remote password of a Linux cloud server are not well understood by most people, so the editor summarizes the following content for you, with detailed content, clear steps, and Certain reference value, I hope you can gain something after reading this article, let’s take a look at this article on how to reset the remote password of a Linux cloud server.</p><p><br/></p><h5>CentOS 8</h5><p>Return to directory</p><p>1. When the GRUB version selection interface appears, press the Esc key immediately. Otherwise, the system will continue to start and cannot proceed to the next step.</p><p><img src="//img.freeonlinedomain.com/uploads/allimg/20230630/1-230630150442635.jpg" title="" alt="1.jpg"/></p><p>2. Select the first kernel and press e to enter the editing interface.</p><p><img src="//img.freeonlinedomain.com/uploads/allimg/20230630/1-2306301505004T.jpg" title="" alt="2.jpg"/></p><p>3. Find the line whose first word is linux, and change ro in this line to rw init=/sysroot/bin/sh. Then press Ctrl+X to start the system in single-user mode.</p><p><img src="//img.freeonlinedomain.com/uploads/allimg/20230630/1-23063015052DL.jpg" title="" alt="3.jpg"/></p><p>4. After the system starts, enter chroot /sysroot to enter the system.</p><p>5. Use the passwd command to reset the password.</p><p><br/></p><p>6. Relabel the file system, then exit and restart the system.</p><p>touch /.autorelabel exit log out reboot</p><p><br/></p><p>7. After the system starts normally, you can successfully log in with the new password.</p><h5>CentOS 7</h5><p>Return to directory</p><p>1. The first 5 steps are exactly the same as the steps for resetting the password in CentOS 8. Only the content of the kernel file is different.</p><p><br/></p><p>2. After resetting the password, enter reboot -f to force restart the system.</p><p><br/></p><p>3. After the system starts normally, you can successfully log in with the new password.</p><h5>CentOS 6</h5><p>Back to Contents</p><p>1. When the Booting CentOS... prompt appears, immediately press any key to enter the kernel selection interface. Otherwise, the system will continue to start and cannot proceed to the next step.</p><p>2. Select the first kernel, press a key to modify the kernel parameters.</p><p><br/></p><p>3. Enter the single character at the end of the line and press Enter.</p><p><br/></p><p>4. After the system starts, use the passwd command to reset the password and restart.</p><p><br/></p><p>5. After the system starts normally, you can successfully log in with the new password.</p><h5>Ubuntu 19.04/Ubuntu 18.04</h5><p>Return to directory</p><p>1. During system startup, press the Esc key immediately to enter the kernel selectioninterface. Otherwise, the system will continue to start and cannot proceed to the next step.</p><p>2. Select the first kernel and press e to enter the editing interface.</p><p><br/></p><p>3. Find the line whose first word is linux, and add init=/sysroot/bin/sh at the end. Then press Ctrl+X to start the system in single-user mode.</p><p><br/></p><p>4. After the system starts, enter mount -o remount,rw / to remount the system.</p><p>5. Use the passwd command to reset the password and force a restart.</p><p><br/></p><p>6. After the system starts normally, you can successfully log in with the new password.</p><h5>Debian 10/Debian 9</h5><p>Return to directory</p><p>1. During system startup, press the Esc key immediately to enter the kernel selection interface. Otherwise, the system will continue to start and cannot proceed to the next step.</p><p>2. Select the first kernel and press e to enter the editing interface.</p><p><br/></p><p>3. Find the line whose first word is linux, and add init=/sysroot/bin/sh at the end. Then press Ctrl+X to start the system in single-user mode.</p><p><br/></p><p>4. After the system starts, enter mount -o remount,rw / to remount the system.</p><p>5. Use the passwd command to reset the password and force a restart.</p><p><br/></p><p>6. After the system starts normally, you can successfully log in with the new password.</p><h5>Fedora 31/Fedora 30/Fedora 29</h5><p>Return to directory</p><p>1. When the GRUB version selection interface appears, press the Esc key immediately. Otherwise, the system will continue to start and cannot proceed to the next step.</p><p><br/></p><p>2. Select the first kernel and press e to enter the editing interface.</p><p><br/></p><p>3. Find the line whose first word is linux, and change ro in this line to rw init=/sysroot/bin/sh. Then press Ctrl+X to start the system in single-user mode.</p><p><br/></p><p>4. After the system starts, enter chroot /sysroot to enter the system.</p><p>5. Use the passwd command to reset the password.</p><p><br/></p><p>6. Relabel the file system, then exit and restart the system.</p><p>touch /.autorelabel exit log out reboot</p><p><br/></p><p>7. After the system starts normally, you can successfully log in with the new password.</p><h5>FreeBSD 12/FreeBSD 11/FreeBSD 10</h5><p>Return to directory</p><p>1. When the system startup interface appears, press 2 to enter single-user mode.</p><p><br/></p><p>2. Use the passwd command to reset the password and restart.</p><p><br/></p><p>3. After the system starts normally, you can successfully log in with the new password.</p><p><br/></p>


Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us