7

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 :)

Chirag thaker
  • 313
  • 1
  • 4
  • 15
  • 3
    Did you do what it says to do at this link: https://docs.npmjs.com/getting-started/fixing-npm-permissions That is the most brain-dead method of forcing an install to work I have ever seen. `chown -R myuser /usr/local`? Even for `/usr/local`, that is epically stupid. And you've apparently found out why. – Andrew Henle May 03 '16 at 12:14
  • /usr/bin/sudo mv /usr/local/bin/sudo{,2} hash -r Refer this https://unix.stackexchange.com/questions/419122/sudo-must-be-owned-by-uid-0-and-have-the-setuid-bit-set?newreg=b2490740fb214ce79c316ad76f859e0a – Sachin Adkar May 27 '19 at 19:45
  • finally, after finding too much i am really thanked https://askubuntu.com/users/10962/user10962 at this link : https://askubuntu.com/a/471503/528411 – Chirag thaker May 03 '16 at 12:44

7 Answers7

20

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
Abhi
  • 284
  • 5
  • 19
1

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....

Keval Mangukiya
  • 1,958
  • 2
  • 9
  • 13
1

Simple fix

1-enter image description here

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

Netwons
  • 700
  • 9
  • 12
0

Try this:

pkexec chown root:root /etc/sudoers /etc/sudoers.d -R

I've succeeded it

Akane153
  • 1
  • 1
0

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
coolbeatz71
  • 720
  • 8
  • 17
0

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

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 24 '21 at 19:28