when I set the EACCESS for npm and I was ran the chown command in my terminal for change owner permission but now i stuck in this sudo :" /usr/bin/sudo must be owned by uid 0 and have the setuid bit set" my version is : ubuntu14.04 LTS please help me guyz :)
First restart your pc, and press the ESC key while Ubuntu is booting.
This will bring you up the boot menu.
Select Advanced Options.
Select your OS version in (recovery mode), and press Enter Key.
It will bring you up another screen. Now select “Drop to root shell prompt” and press Enter.
It will load a command line at the bottom of the screen.
Now run each of the following commands.
mount -o remount,rw /
mount --all
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
shutdown -r now
sudo chmod -R 777 on /bin
and the solution worked –
Estivate $ init 1 $ mount -o remount / $ chown root:root /usr/bin/sudo $ chmod u+s /usr/bin/sudo
$ reboot as suggested by @James Risner & @justme in this thread and it worked for me. :) –
Sobranje If you have root user password then:
1.Login as root user
2.open terminal
3.Enter following cmd's:-
mount -o remount /
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
chown root:root /usr/lib/sudo/sudoers.so && chmod 4755/usr/lib/sudo/sudoers.so
chown root:root /var/* && chmod 4755 /var/*
If you do not have root user password then:
1.Reboot your system in recovery mode(boot and press and hold esc button to enter in recovery mode)
2.Nevigate to (advance option for linux) by using down arrow button and press two times Enter
3.Nevigate to root by using down arrow button and press Enter
4.Now enter following cmd's:-
mount -o remount /
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
chown root:root /usr/lib/sudo/sudoers.so && chmod 4755/usr/lib/sudo/sudoers.so
chown root:root /var/* && chmod 4755 /var/*
5.press ctrl+d and then select resume option to boot normal
Kudos you have made it
For me, I solved this by running these commands:
$ init 1
$ mount -o remount /
$ chown root:root /usr/bin/sudo
$ chmod u+s /usr/bin/sudo
$ reboot
/usr/bin/sudo mv /usr/local/bin/sudo{,2}
hash -r
Simple fix
2-select recovery
3-select root
4-mount -o remount,rw /
5-chmod u=rwxs,g=rx,o=rx /usr/bin/sudo /usr/bin/pkexec
6-reboot or exit
Its beacuase of Permission issue
$ su
Password: <type your root password>
Switch to root user and run the command
# pkexec chmod a=rx,u+ws /usr/bin/sudo
Then check it by typing from the user
$sudo -l
it Works fine for me
Cheers....
Try this:
pkexec chown root:root /etc/sudoers /etc/sudoers.d -R
I've succeeded it
To solve this issue, you need to boot into recovery mode which provides a scroll-down menu with an option to drop down to a root shell
.
And type these commands one after another:
# remount disks in read-write mode
mount -o remount,rw /
mount --all
# return ownership
chown root:root /usr/bin/sudo
# fix permissions
chmod 4755 /usr/bin/sudo
After that, you can reboot and log in again.
You may try this, to know if It worked:
sudo -l
1- Alt + Ctrl + mode + F1
if login root ok if not do is
2- Alt + mode + F1
than do to path /usr/bin
3- cd /usr/bin than do is
chmod u+s sudo su mount umount sg pkexec ping passwd newuidmap newgrp newgidmap ksu gpasswd fusermount expiry chsh chfn chage unix_chkpwd
than do is
chmod g+s wall write locate unix_chkpwd
than change passwd root passwd
4- Alt + Ctrl + mode + F7
Or
5- Alt + mode + F7
than try su to login root
su
if not work do it again and change passwd user and root example my user is mizel
6- su - mizel
root only
7- su
This worked for me
“sudo: /usr/bin/sudo must be owned by uid” Or sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set. Reason :This error occurs when incorrect permission or ownership is set on /usr/bin/sudo file.
Solution
Step 1 : Start the server in Single user mode using command at start.
- init 1
Step 2 : Once single user mode starts use below commands
- mount -o remount,rw /
- - chown root:root /usr/bin/sudo
- - chmod 4755 /usr/bin/sudo
Step 3: Now Reboot the Server and check.
- reboot //(linux command line)
This applies to those environments where they have a docker/Kubernetes environment running and have a host root file system mounted into the container or pod.
In this case, the host's root /
is mounted as /host
inside the pod.
kubectl exec -it mypod -- chown root:root /host/usr/bin/sudo && chmod 4755 /host/usr/bin/sudo
I have not tried creating a fresh Kubernetes pod but I guess, that should work too.
This is pretty fast forward solution to the issue:
Step 1:
$ init 1
Step 2:
$ mount -o remount /
Step 3:
$ chown root:root /usr/bin/sudo
Step 4:
$ chmod u+s /usr/bin/sudo
Step 5:
$ reboot
Login as root by running command:
pkexec bash
Then run:
chown root:root /usr/bin/sudo
chmod u+s /usr/bin/sudo
This worked for me to hanldle this issue I used this command to become a root user:
systemd-run --shell
after that: chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
My problem is solved.
This is my first time as Ken-Andre to write on this channel, because all answer gave here semms so difficult, where for my case i found on other channel, more easier:
- systemd-run --shell
- chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
Hope, that it will work for you too.
© 2022 - 2024 — McMap. All rights reserved.
chown -R myuser /usr/local
? Even for/usr/local
, that is epically stupid. And you've apparently found out why. – Convexoconcave