LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-25-2012, 05:30 AM   #1
awladnas
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Rep: Reputation: Disabled
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

Last edited by awladnas; 11-25-2012 at 05:46 AM.
 
Old 11-25-2012, 05:55 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,438
Blog Entries: 2

Rep: Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001
Quote:
Originally Posted by awladnas View Post
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.
 
Old 11-25-2012, 05:58 AM   #3
awladnas
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
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?
 
Old 11-25-2012, 06:49 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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

Last edited by shivaa; 11-25-2012 at 06:59 AM.
 
Old 11-25-2012, 08:32 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,438
Blog Entries: 2

Rep: Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001
Quote:
Originally Posted by awladnas View Post
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.
 
Old 11-25-2012, 08:38 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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.
 
Old 11-26-2012, 12:58 AM   #7
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,246

Rep: Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025
@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.
 
Old 03-15-2013, 10:20 AM   #8
clunkpt
LQ Newbie
 
Registered: Mar 2013
Posts: 1

Rep: Reputation: Disabled
Just open terminal and do "su"
then just type chmod 4755 /usr/bin/sudo
 
Old 05-19-2013, 06:49 AM   #9
earthling297
LQ Newbie
 
Registered: May 2013
Distribution: Mint
Posts: 1

Rep: Reputation: Disabled
you could try reinstalling it
it worked for me
 
Old 09-20-2013, 03:24 PM   #10
whatsupdeepak
LQ Newbie
 
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
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.
 
  


Reply

Tags
sudo, ubuntu 12.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo: must be setuid root mswamy78 Linux - Newbie 23 11-23-2012 09:20 AM
Linux AMI - Error: sudo: must be setuid root fortran Linux - Server 3 03-21-2012 09:45 AM
[SOLVED] sudo: must be setuid root xrideordie987x Linux - Newbie 7 03-13-2012 11:47 PM
[SOLVED] sudo:must be setuid root rahulkya Linux - Software 7 02-21-2011 03:25 PM
Sorry, sudo must be setuid root kurtdriver Fedora 6 10-22-2008 07:47 PM


All times are GMT -5. The time now is 12:36 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration