Reset root password on Linux machine

Linux 1 Comment

linuxlockedIf you forget your Linux root password, you can maybe reset it if you have physical access to the machine.

  1. Go to the Linux server machine.
  2. You will see the login prompt
  3. Press Ctrl-Alt-Del (three keys at the same time)
  4. The machine will reboot. If Ctrl-Alt-Del doesn’t work, try Ctrl-Alt-Backspace.
  5. Wait for the machine to finish rebooting (this may take a few minutes especially if the machine does a hard drive integrity check on startup).
  6. You will see a lilo: prompt.
  7. Enter linux single to start single user mode.
  8. Enter passwd to set the new root password.
  9. Enter the new root password (you will enter it twice).
  10. Press Ctrl-D to start multi-user mode (which is the normal Linux mode).
  11. You will see the login prompt again.
  12. Enter root for username.
  13. Enter your new root password.
  14. You should be logged in as root.
  15. Enter exit to logout.
1 Comment