Sudo command does not work anylonger

Hi guys,

suddenly the sudo command doesnt work.
the statement
sudo openhabian-config
displays the error message:
/usr/bin/sudo must be owned by uid 0 and have the setupid…

the command ls-l /usr/bin/sudo displayed : -rwxrwxrwx 1 root root 139584

Annyone an idea what i have to do?

please use the search:

this one should work for now:

sudo /opt/openhabian/openhabian-setup.sh

it doesnt solve the problem
the same error:
sudo must be owned by uid 0 and have the setuid bit set

That’s strange - did you change some configuration on Linux-side?

or blunt question: Do you have everything you configured saved, so you can just overwrite your system with a brand new installation and re-configure your system?

not realy
i read that i should reboot in save modus by pressing the shift key.
but i will not work
do you know the exact key?

If you can I’d take a backup of the memory card now, unfortunately this is a fairly big issue and there’s a chance that you may have to reinstall your system. If you remember the commands you used before this issued occured, it may help. Relevant AskUbuntu thread.

I don’t think there’s a safe mode as such for raspbian. However, you might be able to fix this problem by connecting a screen and keyboard into your pi. relevant RasberryPi thread for “recovery options”.

  1. First edit cmdline.txt the /boot partition on the memory-card. (You might have to use another computer)
    • Add a new line with init=/bin/bash at the end.
  2. Place the card in the raspberry pi, and let it boot. You should see that you’re logged in as root.
  3. Enter the command chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
  4. Reboot and see if sudo works.
1 Like

To add to Ben’s advice: save you some headaches and time: save your configuration and restart new would be the best for you, I think.

in either case:

  • take your SD Card and make a image (use win32diskimager, if you’re on windows)
  • if possible, use another SD Card for the vanilla Installation of your new openHABian, so you have at least some access to your files.

Hi,
what will be the expactation afer running the chown/chmod command?

What will be different after the actually state?
ls-l /usr/bin/sudo displayed : -rwxrwxrwx 1 root root 139584

The new line does not affect:

Here the content auf the cmdline.txt

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=35ca62fc-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
init=/bin/bash

Try not as a new line but as a space on the end:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=35ca62fc-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait init=/bin/bash

The output of ls -l /usr/bin/sudo should be:

-rwsr-xr-x 1 root root 135376 Jun  5  2017 /usr/bin/sudo

The s is the important bit here, this is the setuid bit that the error is asking for.

If that doesn’t work, unfortunately you’ll have to backup your important bits, and start with a new instance of Linux.