0

I am not able to use sudo, how to resolve this ?

$ sudo vi /etc/fstab

sudo: effective uid is not 0, is sudo installed setuid root?
0

From the error

sudo: effective uid is not 0, is sudo installed setuid root?

It is clear that the setuid is not set for sudo command. And also the user:group must be root:root.

Just become the root user and make sure that it is set. i.e.

su -
chown root:root /usr/bin/sudo
chmod u+s /usr/bin/sudo

It will set the setuid for the sudo command.

  • This could potentially be a symptom of something more serious. The user should investigate why the sudo executable had the wrong permissions and/or ownership. – Kusalananda Feb 12 at 8:14
  • @Kusalananda yeah right, but that will require more info, like when this behaviour started? – Prvt_Yadv Feb 12 at 8:38
0

The problem is due to changes in the permissions of directory /usr/bin.

To resolve this :

1) First be sure that root is owner of this directory /usr/bin :

 chown root:root /usr/bin

2) and change permission for this file :

 chmod u+s /usr/bin/sudo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.