Skip to content

[LAB IDEA] Lost Root Password #26

Description

@HimanM

Scenario Description

The user is locked out of the root account and sudo access is misconfigured. They must regain root access to the machine.

Root Cause

The root password was changed to an unknown value, and the sudoers file has a syntax error preventing the brokenops user from using sudo.

Setup Instructions

  1. Change root password to a random string.
  2. Introduce a syntax error in /etc/sudoers.

Expected Resolution Steps

  1. Reboot the VM and interrupt the GRUB boot menu.
  2. Edit the boot parameters to append init=/bin/bash or rd.break.
  3. Boot into single-user mode/emergency shell.
  4. Remount the root filesystem as read-write (mount -o remount,rw /).
  5. Run visudo to fix the sudoers file, or run passwd to reset the root password.
  6. Reboot normally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions