Home  >  Article  >  Operation and Maintenance  >  How to reset the remote password of a Linux cloud server

How to reset the remote password of a Linux cloud server

WBOY
WBOYforward
2023-05-11 22:10:111382browse

CentOS 8

Return to the directory

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.

How to reset the remote password of a Linux cloud server

#2. Select the first kernel and press the e key to enter the editing interface.

How to reset the remote password of a Linux cloud server

#3. Find the line where the first word is linux, and change ro in this line to rw init=/sysroot/bin/sh. Then press the Ctrl X key to start the system in single-user mode.

How to reset the remote password of a Linux cloud server

#4. After the system starts, enter chroot /sysroot to enter the system.

5. Use the passwd command to reset the password.

How to reset the remote password of a Linux cloud server

#6. Relabel the file system, then exit and restart the system.

touch /.autorelabel
exit
logout
reboot

How to reset the remote password of a Linux cloud server

#7. After the system starts normally, you can successfully log in with the new password.

CentOS 7

Return to the directory

1. The first 5 steps are exactly the same as the steps for resetting the password on CentOS 8. Only the content of the kernel file is different.

How to reset the remote password of a Linux cloud server

#2. After resetting the password, enter reboot -f to force restart the system.

How to reset the remote password of a Linux cloud server

#3. After the system starts normally, you can successfully log in with the new password.

CentOS 6

Return to the directory

1. When the Booting CentOS... prompt appears, press any key immediately to enter the kernel selection interface. Otherwise, the system will continue to start and cannot proceed to the next step.

2. Select the first kernel and press the a key to prepare to modify the kernel parameters.

How to reset the remote password of a Linux cloud server

3. Enter the single character at the end of the line and press Enter.

How to reset the remote password of a Linux cloud server

#4. After the system starts, use the passwd command to reset the password and restart.

How to reset the remote password of a Linux cloud server

#5. After the system starts normally, you can successfully log in with the new password.

Ubuntu 19.04/Ubuntu 18.04

Return to directory

1. During the system startup process, 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.

2. Select the first kernel and press the e key to enter the editing interface.

How to reset the remote password of a Linux cloud server

3. Find the line where the first word is linux and add init=/sysroot/bin/sh at the end. Then press the Ctrl X key to start the system in single-user mode.

How to reset the remote password of a Linux cloud server

#4. After the system starts, enter mount -o remount,rw / to remount the system.

5. Use the passwd command to reset the password and force a restart.

How to reset the remote password of a Linux cloud server

#6. After the system starts normally, you can successfully log in with the new password.

Debian 10/Debian 9

Return to directory

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.

2. Select the first kernel and press the e key to enter the editing interface.

How to reset the remote password of a Linux cloud server

3. Find the line where the first word is linux and add init=/sysroot/bin/sh at the end. Then press the Ctrl X key to start the system in single-user mode.

How to reset the remote password of a Linux cloud server

#4. After the system starts, enter mount -o remount,rw / to remount the system.

5. Use the passwd command to reset the password and force a restart.

How to reset the remote password of a Linux cloud server

#6. After the system starts normally, you can successfully log in with the new password.

Fedora 31/Fedora 30/Fedora 29

Return to directory

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.

How to reset the remote password of a Linux cloud server

2. Select the first kernel and press the e key to enter the editing interface.

How to reset the remote password of a Linux cloud server

#3. Find the line where the first word is linux, and change ro in this line to rw init=/sysroot/bin/sh. Then press the Ctrl X key to start the system in single-user mode.

How to reset the remote password of a Linux cloud server

#4. After the system starts, enter chroot /sysroot to enter the system.

5. Use the passwd command to reset the password.

How to reset the remote password of a Linux cloud server

#6. Relabel the file system, then exit and restart the system.

touch /.autorelabel
exit
logout
reboot

How to reset the remote password of a Linux cloud server

#7. After the system starts normally, you can successfully log in with the new password.

FreeBSD 12/FreeBSD 11/FreeBSD 10

Return to directory

1. When the system startup interface appears, press 2 to enter single-user mode.

How to reset the remote password of a Linux cloud server

#2. Use the passwd command to reset the password and restart.

How to reset the remote password of a Linux cloud server

#3. After the system starts normally, you can successfully log in with the new password.

The above is the detailed content of How to reset the remote password of a Linux cloud server. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete