In ubuntu 11.04 I seem to have messed up the permissions/ownership of the /usr/ directory. It won't let me sudo -s to fix them!

sudo: must be setuid root

and I can't login as root because I'm on ubuntu and don't know the password. Does anybody have any advise? I also can't change the boot menu for the same reason.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

Boot from a live CD and then either:

  • mount the root partition and ad setuid to sudo binary

mount /dev/sdxx /mnt
chmod +s /mnt/usr/bin/sudo
  • mount the root partition, chroot and change root password

mount /dev/sdxx /mnt
mount --bind /dev/ /mnt/dev/
chroot /mnt
passwd

Where /dev/sdxx is your root partition

link|improve this answer
Its the best answer but not quite what I wanted. Moral= always set the root password! – Misha Jul 20 '11 at 2:52
feedback

Your Answer

 
or
required, but never shown

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