Linux reset password (Debian based)

Fri, November 22, 2024 - 1 min read
Dive in how to work around.

1. Configuration

  • Linux has a grub configuration to initialize our OS
  • Press E enter on grub mode (if your grub doesn’t show) PS: it could be other character
  • Press E to enter into edit mode
  • Look for a line that begins with linux and probably ends with quiet

then follow the command to call bash on the next initialization after grub

rw init=/bin/bash

Wait to enter as $roort#

2. Setting password

passwd [user]

For list user you can use (you find probably at end of the list):

less /etc/passwd

To restart you can’t use shutdown because it’s not started the OS itself, so use the following command to restart:

exec /sbin/iinit 6

3. Done! You has changed the user password!

This is only for study or necessity cases use at your own responsibility