changed uid of /etc/sudoers. sudo doesn't work now !!!

Hi All
Accidentally I changed the ownership of all the directories under / to my own instead of root:root.
Now I am unable to use sudo and many bad things are happening.
Is there a way to revert the changes or change the permissions again to root:root or make sudo work ?

TIA
asd

On 08/10/2011 01:36 PM, paladin007 wrote:
>
> Hi All
> Accidentally I changed the ownership of all the directories under / to
> my own instead of root:root.
> Now I am unable to use sudo and many bad things are happening.
> Is there a way to revert the changes or change the permissions again to
> root:root or make sudo work ?

Tsk. Boot a rescue disk, mount the appropriate partition/file system, and fix
the ownership.

You do not need sudo to become *root. *Use

su -

in a terminal (maybe best in the console itself in this case). It asks of course for the root password (you will not see any echo of this).

When it is only the directories direct under / then you can make root the owner again, but when you use the -R option and thus changed all inside, you have a big problem.

EDIT: it is not clear what you exactly changed. In the title you say /etc/sudoers, but in the text all inside /, that is also /etc, but not /etc/sudoers. ???

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Tsk. Boot a rescue disk, mount the appropriate partition/file system,
> and fix the ownership.

In lieu of a rescue disk it may be worthwhile to try the following on the
end of your Grub line while booting which should just drop you to a prompt:

init=/bin/bash

Once there, fix your sudoers file and reboot to see if it’s all better.

chown root:root /etc/sudoers
chmod 440 /etc/sudoers

Good luck.


Want to yell at me in person?
Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOQtXkAAoJEF+XTK08PnB5TzgP+wdKrmAIOpqvdkUeZy/EUCyy
BHPI0GB7aM62B4XW8dY65YoMAwxpaJeNcdWFQr+juj7w4YZK7RFvQwJqD3b6PVbJ
ES91ZQmRV+8aG5tDBUeAXw4ec8dsOaeiw5WwLB1qsdK3BBSo6gZHtDHIBSnLcIHr
EmrmcO2OmhLELMh05Zh6V925yUecy9LQjTi+EiW2fOZnrvQi0h9Clwcyx+PiVwOM
aRTtihGm0Y1UGyZE/PwTqqOhtQNVAiGgEaEHqJNdAw8yd4AIpgEAKmx53HOMC7XS
eUVzg0dN/ew+HtCAi7IBaF53vC6IH7yakv9CDpXkQjyK3JYqZ5/pUxPbed/6Or2z
VXSPcYaI0UMpiKQ0za9VgaFddzSjVss2Z247big7N0BvxltGigy935L+zYfIsCUB
pvoHqtAA4N6EMwys9GtDlUbe9JMqdJBT6N6/7ZZ3VY9yoH4qqh75NrXUy2JZQF28
dNezTjtcdwCJL2PZl7kgoCLGm7P9FeXgUiAI0+igFsU3OLcgbx7ni1Fpf4O2cgL9
nh2KW5hspCG2qcn4zrwT5U4pdNcB3jSJSz5PbQ3Wmbk5Y6hnRE/WDXolSKflf3Ih
JrVoynMIFOtKyVRlcsFIJj3UXJjey7D3c7E7Q0/oTxUWKA6qLFmQddNjxoFFtoLF
P4Q0YZWPb4mOueeEpOEs
=LcXU
-----END PGP SIGNATURE-----