SUDO Error "sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set"
After connecting to the instance as an opc user, when you try sudo to root user, the following error is seen:
[opc@<hostname> ~]$ sudo su -
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
The above error occurs because ownership and permissions of /usr/bin/sudo were changed.
/usr/bin/sudo file must be owned by root, if not the binaries cannot be executed.
$ ls -al /usr/bin/sudo*
---x--x--x. 1 oracle oracle 143248 Jun 26 16:26 /usr/bin/sudo
lrwxrwxrwx. 1 oracle oracle 4 Aug 14 01:05 /usr/bin/sudoedit -> sudo
---x--x--x. 1 oracle oracle 49008 Jun 26 16:26 /usr/bin/sudoreplay
From the above example, it's clear that the owner of the binaries is not
Tagged:
0