Using a Different System?
Introduction
If you are locked out of your CentOS instance and have lost access to the root account, you need to boot into single-user mode and reset the root password. You'll find instructions below for CentOS 6, 7, 8, 8 Stream, and 9 Stream.
Connect to the Console
Click the Server Restart icon in the Vultr customer portal.

Open the web console.

You can also reboot the server from inside the web console. See the Web Console FAQ for more information.
Follow the steps below for your version.
CentOS 6
- As the system boots, GRUB prompts you to press any key to stop the boot process. Press a key quickly; you only have a few seconds. If you miss the prompt, you need to restart the server from the control panel and try again.
- At the GRUB prompt, type A to append to the boot command.
- Add a space and the text
single
to the end of the line.
- Press ENTER.
- The system will boot, and you will see the root prompt.
- Type
passwd
and follow the prompts to change the root password.
- Run
reboot
to reboot the server.
CentOS 7
- As the system boots, press ESC to bring up the GRUB boot prompt. The prompt happens early in the boot process. If you miss the prompt, you need to restart the server from the control panel and try again.
- At the GRUB boot prompt, press E to edit the first boot option.
- Find the kernel line starting with linux16.
- Change
ro
to rw init=/sysroot/bin/sh
.
- Press CTRL+X or F10 to boot into single user mode.
- Access the system with the command:
chroot /sysroot
.
- Type
passwd
and follow the prompts to change the root password.
- Run
touch /.autorelabel
to force file system relabeling. This is required for systems with SELinux. When you reboot the system, it will relabel the filesystem for SElinux. The reboot may take extra time during this process.
- Run
exit
.
- Run
reboot -f
to reboot the server.
CentOS 8 & CentOS 8 Stream
- As the system boots, press ESC to bring up the GRUB boot prompt. The prompt happens early in the boot process. If you miss the prompt, you need to restart the server from the control panel and try again.
- At the GRUB boot prompt, press E to edit the first boot option.
- Find the kernel line starting with linux.
- Change
ro
to rw init=/sysroot/bin/sh
.
- Press CTRL+X or F10 to boot into single user mode.
- Access the system with the command:
chroot /sysroot
.
- Type
passwd
and follow the prompts to change the root password.
- Run
touch /.autorelabel
to force file system relabeling. This is required for systems with SELinux. When you reboot the system, it will relabel the filesystem for SElinux. The reboot may take extra time during this process.
- Run
exit
.
- Run
logout
.
- Run
reboot
to reboot the server.
CentOS 9 Stream
- As the system boots, press ESC to bring up the GRUB boot prompt. The prompt happens early in the boot process. If you miss the prompt, you need to restart the server from the control panel and try again.
- At the GRUB boot prompt, use the arrow keys to highlight one of the rescue kernels and press E to edit the boot options.
- Find the kernel line starting with linux.
- Change
ro
to rw init=/sysroot/bin/sh
.
- Press CTRL+X or F10 to boot into single user mode.
- Press ENTER to enter maintenance mode.
- Access the system with the command:
chroot /sysroot
.
- Type
passwd
and follow the prompts to change the root password.
- Run
touch /.autorelabel
to force file system relabeling. This is required for systems with SELinux. When you reboot the system, it will relabel the filesystem for SElinux. The reboot may take extra time during this process.
- Run
exit
.
- Run
reboot
to reboot the server.
Want to contribute?
You could earn up to $600 by adding new articles.