LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sudo: effective uid is not 0, is sudo installed setuid root? (http://www.linuxquestions.org/questions/linux-newbie-8/sudo-effective-uid-is-not-0-is-sudo-installed-setuid-root-4175438614/)

awladnas 11-25-2012 05:30 AM

sudo: effective uid is not 0, is sudo installed setuid root?
 
I'm new in linux ubuntu 12.04. i was installing jdk7. now when i run any command with sudo like :


sudo chown -R awlad /usr/

<b> sudo: effective uid is not 0, is sudo installed setuid root? </b>
i've googling for this about 2 hours.how can i solve this
more info:
ls -l $(which sudo)
give me:
-rwxr-xr-x 1 awlad root 112888 Jul 16 18:14 /usr/bin/sudo

TobiSGD 11-25-2012 05:55 AM

Quote:

Originally Posted by awladnas (Post 4836470)
I'm new in linux ubuntu 12.04. i was installing jdk7. now when i run any command with sudo like :


sudo chown -R awlad /usr/

<b> sudo: effective uid is not 0, is sudo installed setuid root? </b>
i've googling for this about 2 hours.how can i solve this
more info:
ls -l $(which sudo)
give me:
-rwxr-xr-x 1 awlad root 112888 Jul 16 18:14 /usr/bin/sudo

Have you run a command like that successfully before? If yes then you have borked your machine. Changing the owner of all files in /usr to your own unpriviledged user is exactly what would cause such issues and is a good way to break your system.

awladnas 11-25-2012 05:58 AM

Quote:

Originally Posted by TobiSGD (Post 4836479)
Have you run a command like that successfully before? If yes then you have borked your machine. Changing the owner of all files in /usr to your own unpriviledged user is exactly what would cause such issues and is a good way to break your system.

thanks for your reply. Yes may be i'm not sure. is there any way to overcome it?

shivaa 11-25-2012 06:49 AM

Executable file /usr/bin/sudo must have root as owner, not any other user. And that is why it is saying that effective UID isn't 0 (since root has EUID equal to 0). Also note that changing owner of /usr/ may cause other problems to your system. So better try to change owner of /usr/bin/sudo, and then try installing jdk.
Code:

sudo su - root
chown -R root:root /usr/bin/sudo

Then try to install jdk.
If you get permission denied type of error while using sudo cmd then, check whether you've permissions to invoke it or not, using:
Code:

sudo -l

TobiSGD 11-25-2012 08:32 AM

Quote:

Originally Posted by awladnas (Post 4836481)
thanks for your reply. Yes may be i'm not sure. is there any way to overcome it?

Something like that will normally cause a whole bunch of weird effects, the one with sudo you now can see is one of the harmless ones because it gives you a clear error message. If other issues occur I would recommend a clean re-install.

shivaa 11-25-2012 08:38 AM

I would add, the executable /usr/bin/sudo has SUID set on it (-rwsr-xr-x), which means, when you will execute /usr/bin/sudo, you will get same authorization what it's owner i.e. root has. This concept is used for many other executables utilities such /usr/bin/passwd. So simple solution is to change it's owner to root again as suggested above.

chrism01 11-26-2012 12:58 AM

@shivaa: As TobiSGD has pointed out, if the OP has run a cmd to change multiple file ownerships/perms, trying to fix them manually would be almost impossible and in the meantime could be open to exploits.
A re-install would be best.
There is a way to fix rpm based systems (http://www.cyberciti.biz/tips/reset-...ermission.html) but it looks like .deb systems like Ubuntu can't do that.

clunkpt 03-15-2013 10:20 AM

Just open terminal and do "su"
then just type chmod 4755 /usr/bin/sudo

earthling297 05-19-2013 06:49 AM

you could try reinstalling it
it worked for me

whatsupdeepak 09-20-2013 03:24 PM

Just came across this thread as I ran into same issue "effective uid is not 0, is sudo installed setuid root" message, when trying to use 'sudo su -' command.
Here are my 2 cents. After you have checked /usr/bin/sudo and /usr for proper permissions and ownerships etc etc, check your /etc/fstab file, and take out the option 'nosuid' for /usr, if it is there.
Good luck.


All times are GMT -5. The time now is 04:04 PM.