Wednesday, March 27, 2019

ubuntu - sudo not working alongwith su


I am using a Ubuntu system. Today, I accidentally changed the sudoers file in /etc due to which my normal user prathmesh is not able to perform sudo operation. I don't know how to go to the root mode. I am trying "su" but it is giving me authentication failure error. Plus I don't remember setting root user's password ever.


What is the best way to solve this situation ?? Use a live CD to change the sudoers file or something else ??


Answer



You have two easy ways:



  1. use the Ubuntu installation CD, choose the "rescue a system" option and then drop into the shell (of the target system) to change the password of the user(s) or modify the /etc/sudoers to your liking.

  2. boot into single user mode and modify the passwords or /etc/sudoers.


The second method may be hard on more recent Ubuntu versions where GRUB doesn't wait for you to choose the single user mode.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...