-
@ DrStacker
2024-08-30 00:55:19Changing Passwords in Linux Using GRUB
-
Access the GRUB Menu: Reboot your system and hold down the Shift (BIOS) or press the Esc (UEFI) key to access the GRUB menu.
-
Edit the GRUB Entry: Highlight the Linux entry and press 'e' to edit.
-
Modify Boot Parameters: Find the
linux
orlinux16
line and addsingle
orinit=/bin/bash
at the end. Press Ctrl + X or F10 to boot. -
Remount the Filesystem: If booted into a bash shell, run
mount -o remount,rw /
to remount the filesystem as read-write. -
Change the Password: To change the root password, run
passwd
. For a user, runpasswd username
. -
Reboot the System: After changing the passwords, reboot the system by running
exec /sbin/init
orreboot
. -
Log In: Log in with the new root or user password.
originally posted at https://stacker.news/items/666211
-