Sudo Broken

There was an error in my friend’s lappy when she tried to install something. The error was like shown below.

sudo: /etc/sudoers is owned by uid 1001, should be 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

Then we checked the permissions of /etc folder through the command “ls -l” and mistakenly she has changed the ownership of the folder /etc/sudoers to specific user.

Then we  remount the filesystem (/) as read-write after dropping to root shell in recovery mode.

mount -o remount,rw /

The first command remounts the root linux partition as read/write so that I can make changes to the files.

For more details on mount command refer the link.

http://www.bleepingcomputer.com/tutorials/introduction-to-mounting-filesystems-in-linux/

Then changed the ownership of /etc folder through the command

sudo chown root:root /etc -R

And after that reboot the system and problem is solved.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s