Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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