Getting Message "Sudo: Must Be Setuid Root", But Sudo Is Already Owned by Root

Getting message sudo: must be setuid root , but sudo IS already owned by root

You have to be able to log in as root, but if you can you can run this

chmod u+s /usr/bin/sudo

And fix the problem

PHP shell_exec() and sudo: must be setuid root

Is the sudo executable itself setuid root? You may need to

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

sudo/suid non-root nesting fails

I'd suggest using sudo to drop privileges rather than doing so yourself -- that's a bit more thorough where possible, modifying effective as opposed to only real uid and gid. (To modify the full set yourself, you might try changing setuid() to setreuid(), and likewise setgid() to setregid()).

...this would mean passing something to Popen akin to the following:

["sudo", "-u", "your_username_here", "--"] + cmd_args

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

I just had this same exact problem on Mac OS after strangely deciding to screw my own system by doing: sudo chmod -R /usr/bin. If that's someone else's case just open Disk Utility, select your OS disk ("Macintosh HD" in my case), go to First Aid tab then hit Repair Disk Permissions, wait a few and things should get fixed.

sudo: effective uid is not 0, is sudo installed setuid root? (on mac os x 10.12)

If you run ls -la /usr, the result most likely will be something like below:

total 0
drwxr-xr-x@ 11 root wheel 374 Oct 14 14:35 .
drwxr-xr-x 32 root wheel 1156 Oct 26 09:49 ..
drwxr-xr-x 19 root wheel 646 Oct 10 18:51 local
... (some other files and directories)

Now it's obvious from the above that unless you are logged in as a root or your user is in the wheel group (which is most likely not), any command you issue with your user which needs write permission (such as brew update) will fail.

One of the possible solutions (and I am not claiming is the best one) would be to change permissions of /usr/local.

Like so:

sudo chown -R $(whoami) /usr/local

Interestingly enough, if you then run

brew update

all goes well and you get the following message:

=> Migrating HOMEBREW_REPOSITORY (please wait)...
==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
sudo chown root:wheel /usr/local

Which I guess explains what happened in the first place.

Hope that helps.

Travis sudo is disabled

Sudo access is turned off on our Docker based architecture, which will be used in two contexts:

  • repositories opt in using sudo: false in their .travis.yml file (it additionally needs to be turned on on our side)
  • on our educational program (see http://education.travis-ci.com)

Builds running on our Docker based architecture currently cannot be allowed sudo access due to certain security concerns in the LXC/Docker layer. We hope this will be fixed in the near future, but unfortunately the issue is out of our own hands.

We are also working on improving the Firefox addon, which currently uses sudo itself, but shouldn't. We'll post on our blog once this has happened.



Related Topics



Leave a reply



Submit