2

Reset the Root Password on AlmaLinux

 2 years ago
source link: https://www.vultr.com/docs/reset-the-root-password-on-almalinux
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
<?xml encoding="utf-8" ??>

Introduction

If you are locked out of your AlmaLinux instance and have lost access to the root account, you need to boot into single-user mode and reset the root password.

How to Reset the Root Password

  1. Click the Server Restart icon in the Vultr customer portal.

    Server Restart

  2. Open the web console.

    Vultr Web Console

    You can also reboot the server from inside the web console. See the Web Console FAQ for more information.

  3. 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.

  4. At the GRUB boot prompt, press E to edit the first boot option.
  5. Find the kernel line starting with linux.
  6. Change ro to rw init=/sysroot/bin/sh.
  7. Press CTRL+X or F10 to boot into single user mode.
  8. Access the system with the command: chroot /sysroot.
  9. Type passwd and follow the prompts to change the root password.
  10. 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.
  11. Run exit.
  12. Run logout.
  13. Run reboot to reboot the server.

Want to contribute?

You could earn up to $600 by adding new articles


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK