Linux Password Reset: Step-by-Step Guide
The power and flexibility of the Linux operating system allow users to customize their systems. However, sometimes a forgotten password can become a significant barrier to unlocking this powerful system. In this guide, we will explain the "linux password reset" process step by step, so you can easily get help when needed.
Password Reset via Safe Mode
If you've forgotten your password when trying to log into your Linux system, resetting the password in Safe Mode is an effective solution. Safe Mode runs the system with minimal resources, allowing you to perform basic troubleshooting tasks.
- To access the GRUB menu, start your computer and hold down the Shift key.
- In the GRUB menu, select your operating system and press e to enter edit mode.
- Find the Linux line and add the word
single
at the end of the line.
- Save your changes and press Ctrl + X to boot the system.
- The system will boot in Single User Mode. Here, you can access the command line with root privileges.
- To reset the root password, use the
passwd
command to set a new password.
Resetting the Password in Single User Mode
Single User Mode in Linux is ideal for system administrators to perform recovery tasks. In this mode, only essential system services run.
- Restart your system and open the GRUB menu.
- Select the operating system line, then press e to enter edit mode.
- Add
init=/bin/bash
at the end of the Linux line.
- Press Ctrl + X to boot the system into Single User Mode.
- Run the command
mount -o remount,rw /
to enable write permissions on the file system.
- Change the root password by using the
passwd
command.

Password Recovery via GRUB
Password recovery via GRUB is another effective way to access your system. This method can be used once you have access to the GRUB menu.
- Restart your computer and press the Shift or Esc key to access the GRUB menu.
- Select your operating system and press e to enter edit mode.
- In the line related to the kernel, change
ro
to rw
and add init=/bin/bash
at the end.
- Press Ctrl + X or F10 to boot the system.
- In the command line, run the
passwd
command to set a new password.
Resetting the Password Using a Live USB
If you cannot access a working Linux system, you can use a Live USB to boot the system and reset the password.
- Create a Live USB with your preferred Linux distribution and insert it into your computer.
- Restart your computer and select boot from USB in the BIOS/UEFI settings.
- Boot the system with the Live USB and open a terminal.
- Use the command
fdisk -l
to list the disk partitions of the system.
- Mount the installed system using the
mount
command, for example: mount /dev/sda1 /mnt
.
- Run the command
chroot /mnt
to chroot into the mounted root filesystem.
- Change the root password using the
passwd
command.
Techniques for Resetting the Root Account Password
The root account is the most privileged user on a Linux system. Various techniques can be used to reset the root password.
- Access the root account through GRUB or Single User Mode.
- After logging in with root privileges, use the
passwd
command to set a new password.
- For security reasons, restart the system after resetting the password and try logging in in normal mode.
Frequently Asked Questions
- Does resetting the Linux password delete my data?
No, password reset usually does not affect system data. However, it is recommended to back up your system just in case.
- Which method is the safest?
Each method has its advantages, but using a Live USB to reset the password may be a safer option to prevent unauthorized access by other users.
- What should I do if I cannot access the GRUB menu?
If you cannot access the GRUB menu, check the boot priority in your system's BIOS/UEFI settings and use the appropriate key combination to access GRUB.