← Volver al blog

How to Recover a Forgotten Password in Linux

  • Xernode
  • 1 min de lectura
  • 18 de marzo de 2026
Linux password root security linux recovery

Introduction:
Forgot your Linux password? Don’t worry! Here’s a quick way to reset it using single-user mode.

Step-by-step Guide:

  1. Reboot your server.
  2. At the GRUB menu, select your Linux entry and press e to edit.
  3. Find the line starting with linux and add init=/bin/bash at the end.
  4. Press Ctrl + X or F10 to boot.
  5. Once booted, run:n
    • mount -o remount,rw /
    • passwd root
  6. Enter your new password.
  7. Reboot with:n
    • exec /sbin/init

Recommendations:

  • Use a strong password.
  • Disable root login via SSH for security.

Call To Action:
Need a secure VPS for Linux? Try our plans now! https://xernode.com/#pricing

Related Guides