0

I'm currently using Debian 10.9 buster release with gnome 3.30.2

I forgot my login and root password but I've had auto-login enabled i.e., I'm automatically logged in after a reboot or power on but, I'm unable to perform admin tasks / tasks related to sudo command.

So to reset my password, most of the ways I know of, need sudo previliges and the one way which doesn't involve any use of gnome session terminal is through the use of advanced settings from grub menu but as you can see, my grub disappears in just a flash ( inferring from the grub config below) i.e., grub is hidden and the timeout is zero, precluding me from accessing advanced settings via grub and ironically, I need sudo previliges to reconfig my grub

My grub config looks something like this -

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

Is there a way out of this predicament ?

I need this issue to be resolved asap, since I've got glut of (incomplete) work to complete.

0
2

Use a live usb of any linux os and boot into the live environment, then mount your root partiton in the live environment and edit the /etc/sudoers file in the mounted partition and add the following line. Say your username is prithvi, then prithvi ALL=(ALL:ALL) NOPASSWD: ALL, Now you have root privileges without root password. Boot into your machine and change password of superuser using sudo passwd command

5
  • Will it not ask me sudo password for mounting and accessing sudoers file ?
    – Prithvi
    Jul 5 at 3:36
  • @prithvi It will not ask for root password in live environment. You will have root privilages in live environment by default.
    – Shah Fahad
    Jul 5 at 5:01
  • Well, you solution made my day. It worked. Thanks a lot, fayad.
    – Prithvi
    Jul 5 at 18:31
  • 1
    I suggest you to remove the line you added in /etc/sudoers file, after changing root password. Also if this has helped, you may accept the answer.
    – Shah Fahad
    Jul 6 at 2:25
  • Yeah, I've removed NOPASSWD from /etc/sudoers & accepted your answer as well.
    – Prithvi
    Jul 8 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.