89luca89 / distrobox

Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
https://distrobox.it/
GNU General Public License v3.0
9.82k stars 398 forks source link

[Error]sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set #721

Closed LaneaLucy closed 1 year ago

LaneaLucy commented 1 year ago

Describe the bug Created a container with systems and installed some software. After exit the container, stop it and then enter it again, I can't use sudo anymore. Getting "sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set"

To Reproduce distrobox-create -i docker.io/jgoerzen/debian-base-minimal --name dab --init distrobox enter dab git clone https://github.com/opendigitalradio/dab-scripts.git sudo bash dab-scripts/install/mmbtools-get --branch master install -- until here everything works normal -- exit distrobox stop dab distrobox enter dab sudo nc

Expected behavior I think, the expected behavior of sudo is self explaining.... It shouldn't say "sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set"

Desktop (please complete the following information):

Additional context The software I installed still works, but I need netcat for some other software, which is only found, when being executed with sudo...

Edit: and I'm running on steam Deck...

89luca89 commented 1 year ago

Hi @LaneaLucy this is due to the dab-scripts you run.

In install/mmbtools-get line 317 it does a: chown --recursive ${odr_user}:${odr_user} /home/${odr_user}

This will include the files of the containers, thus setting the sudo in the container as owned by your user.

This is not a bug in distrobox, maybe you can contact the developers of that project to exclude the container files from that recursive chown,

LaneaLucy commented 1 year ago

Thx, that really helped