DEV Community

Mohan Upadhyay for The Coders Blog

Posted on β€’ Originally published at thecodersblog.com on

3

Reset root or user password of linux (Ubuntu/debian) OS

If you accidentals locked-out or want to change the root/user password at any cost - you can reset it.

Side effect & Note: Previous users login.keyring will not work. Hence, you will loss all previously saved wifi/network drives as well as Google Chrome profile settings (until you remember the old password and unlock it).

To reset follow the following steps.

  1. Reboot pc
  2. Hold SHIFT during boot to start GRUB menu
  3. Highlight your image and press E to edit GRUB config (change will reset after reboot)
  4. Find the line starting with β€œlinux”
  5. Append rw init=/bin/bash at the end of that line
  6. Press CTRL + X to continue the boot
  7. Change password with command passwd USERNAME
  8. Reboot with CTRL+ALT+DEL
  9. Log in using the new password

If you want to backup your keyring file to try unlocking it later save the following file:

/home/user/.local/share/keyrings/login.keyring
Enter fullscreen mode Exit fullscreen mode

Image of Stellar post

πŸš€ Stellar Dev Diaries Series: Episode 1 is LIVE!

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

Top comments (0)