[PLUG] I broke sudo

wes plug at the-wes.com
Wed Nov 5 16:57:03 UTC 2008


On Wed, Nov 5, 2008 at 9:44 AM, John Jason Jordan <johnxj at comcast.net>wrote:

> Hardy x86_64, more or less up to date.
>
> This morning Update Manager launched fine and displayed 10 updates. I
> clicked on the button to install the upgrades. Normally this pops up a
> window asking for the root password. This time it did not. Update
> Manager searched for a bit, then did nothing.
>
> I can also do updates with Synaptic, so I closed Update Manager and
> launched Synaptic. That is, I tried to launch it, but nothing happened.
> It would not launch. Now, Update Manager uses code in common with
> Synaptic, so clearly whatever was wrong with Update Manager is also
> affecting Synaptic.
>
> Being a clever little Linux dude I opened a terminal and typed
> "sudo synaptic" to see what kind of error messages I got. And sure
> enough, I got an error message:
>
> jjj at Devil7:~$ sudo synaptic
> sudo: must be setuid root
> jjj at Devil7:~$ sudo su
> sudo: must be setuid root
>
> So I googled on "must be setuid root" and found a thread in the Ubuntu
> forums:
>
> http://ubuntuforums.org/showthread.php?t=219767
>
> It turns out that the problem listed in the thread is exactly what
> happened. A few days ago I needed a graphic located in /usr and I
> couldn't get it into the Gimp in anything but read-only mode. The
> graphic came as part of the openclipart package that I installed a long
> time ago with Synaptic. I have no idea why the package installed the
> graphics into /usr with root ownership instead of into ~/.
>
> The part I did wrong was that I took ownership of the whole /usr folder
> instead of just the /usr/share/openclipart folder. That broke sudo.
> Fortunately I am not the first Ubuntuoid to do this, and the forum
> thread gives instructions for how to fix it. However, the instructions
> are not working:
>
> jjj at Devil7:~$ ls -l /usr/bin/sudo
> -rwxr-xr-x 2 jjj jjj 122688 2008-09-10 12:42 /usr/bin/sudo
> jjj at Devil7:~$ chown root:root /usr/bin/sudo
> chown: changing ownership of `/usr/bin/sudo': Operation not permitted
> jjj at Devil7:~$ chmod 4755 /usr/bin/sudo  #note that this operation worked
> jjj at Devil7:~$ sudo su
> sudo: must be setuid root
> jjj at Devil7:~$ chown root:root /usr/bin/sudo
> chown: changing ownership of `/usr/bin/sudo': Operation not permitted
> jjj at Devil7:~$ chmod 0440 /etc/sudoers
> chmod: changing permissions of `/etc/sudoers': Operation not permitted
> jjj at Devil7:~$ sudo su
> sudo: must be setuid root
> jjj at Devil7:~$ chmod 4755 /bin/su
> chmod: changing permissions of `/bin/su': Operation not permitted
>
> OK, not such a clever little Linux dude after all.
>
> The computer continues to run just fine, but I have no access to sudo.
> Before I mess things up even more I thought I'd ask here for help from
> someone who understands permissions and ownership better than me.
>

If you have the root password, try just running "su" by itself and enter
that password. Then the chown root:root /usr/bin/sudo should work and you're
back in business.

-wes



More information about the PLUG mailing list