Tuesday 11 June 2013

No valid sudoers sources found quitting ubuntu

1 comment
This error happen due to change in permission of sudoers file.
Pkexec command is used to execute command as another user. Older versions of Ubuntu don't support this command. If you are able to use pkexec command then you are not require to reboot and go to recovery mode use following commands

pkexec chown -R root:root /etc/sudoers.d
pkexec chmod u=rwx,g=rx,o=rx /etc/sudoers.d/
pkexec chmod u=r,g=r,o= /etc/sudoers.d/*


If you are running on old versions which could not support pkexec then you require to use recovery mode.
You can go into recovery mode by selecting grub menu ending with recovery mode option ->root -> give root password
after this enter command

fdisk -l (gives all detail disk partition)

Since in ubuntu recovery mode is read only you will require to remount in read-write mode using following command

mount -o remount,rw /dev/sda(drive containing installation i.e root)
now enter above commands without pkexec as below

chown -R root:root /etc/sudoers.d
chmod u=rwx,g=rx,o=rx /etc/sudoers.d/
chmod u=r,g=r,o= /etc/sudoers.d/*


now reboot and you will be able to use sudo or su command

1 comment: