Linux - NewbieThis 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

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

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.

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?

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:

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.

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.

@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.

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.

## for tmp dirs, we can also add tmpwatch app on most Linux ..wich then is easily started once, on restart of box.. so need universal-starter.sh made also (todo's)
chmod 660 /var/log/tmp
chmod 660 /var/log/wtmp
chmod 660 /var/run/utmp
chmod 660 /var/log/btmp

## Small read-on section, explaining wqhat is todo,has been done and, ofc, still it is in TESTING on CentOS-6
## ok some simple addins wich are essential (this will both kill most auditd bugs and mainly the udev.d 0days),but really need a perl-pipe-upload blocker,and a FWall tht GOOD!
## wich can add ips as it is being attackd, wich can have own sigs added, or, even script to generate those rules for the ips, and how the rule should be structered.Simply
## using methods like --hash-limit ,will almost kill your use of TCp,so, i have made eth0 based ipv4/6; */network/interface/eth0/* ipv4 or ipv6/ then, modified EACH rule
## THEn there is KNOWN blocks of IPS like, ones we do NOT need, nor will ever use for anything BUT these are also many of boxes wich are pwnable,so must kill them thru iptables
## mixed with (BSD: sysctl.conf and Linux is thru interfaces/ to achieve same thing),BSD has a few different places,and handles tmp dirrently,and will be added to universal
## script for setup of boxes,and for adding of users, after the actual setup scripts,and ip6tables* ipfw6/pf ,must also be accounted for,but on BSD,it use many things.
## Also dont be scred to use some anti-* scripts,nor ddos_deflate, IF you set it right, it works gr8,aswith an upto-date A/V,one wich will find shelling,bindshells,rkits.
## WILL be added/done for Linux/BSD and, will have 2-3 scripts wich you basically then get info for on howto use, plz,dont beg me for shit, if your luicky, and ask, i will ask
## you maybe for some minor helps like, login.sh wich, i would LOVE to be able to make asciigenerator for the motd,and, basically GUI for setting motd,banner.
## MAIN todo, i thik is to check some methods out on restricting /sbin/nologin accounts,passwd/shadow,and blocking even root user echoing to those files,MUST use editor as root
## that, then, i gues, adding as we find new problems, ie; XML,TYP03 ,and other Java/Pdf/Browser exploit stuff wich MAY be used on linux websites hacked,and need to kill these.

## not many people think about 'dash' or 'ash' but theyre BOTH used BUT permissions are VERY different
chmod 511 /bin/dash
chmod 511 /bin/ash
chmod 511 /bin/sh

## this can maybe JUSt be the config wich need to have 100% chmod,but dont know if /ssh/ is useful to blockout. i dont see any harm,so this would be better,or add more to chmod.
chmod 700 /etc/ssh/sshd_config
chmod 700 /etc/ssh/*
chmod 700 /etc/hosts.allow
chmod 700 /etc/hosts.deny
chmod 700 /etc/hosts.equiv

## MAKESURE you do chmod the '/etc/sudoers' file, or it will NOT work right! MUST be,always 0440 .
chmod +x `which sudo`
chmod 440 /etc/sudoers

## Other GOOD ways to chmod what we need ONLY in /etc ,not the WHOLE dir.Pretty easy way to get out of doing a 'good' script/job,so,do BY FILE you NEED ONLY.
## Now we add syslog-ng and use this BUT remmeber rsyslogd ,is STILL active..so must edit syslogging conf, for this and other 'notifiers' of abusive stuff,ie; root-use eMech,etc
chmod 700 /etc/sysctl.conf
chmod 700 /etc/syslog.conf
chmod 700 /etc/syslog-ng.conf
chmod 700 /etc/pam.conf
chmod 700 /etc/profile
chmod 700 /etc/bashrc
chmod 700 /etc/cshrc
chmod 700 /etc/tcshrc
chmod 700 /etc/fstab
chmod 700 /etc/php.ini
chmod 700 /etc/php.conf

along with the o/s , might help... oh, i had to run dpkg-reconfigure vsftpd for vsftpd users,thats only way to reset your configs then just reset that up.. theres alot still untouched, but this atleast gives you a chance... and heym , now my vps loaded all init scripts etc fine no erors...so i have somewhat reccovered from this on debian ** (remember deb was apprently not possible,..and frankly i tried everything..until the above when i removed the sudoers file from sudoers.d it seeemed to work as there is a sudoers.tmp file wich seems visudo will create, thats the problem in debian.. you have to reset your sudoers file in /etc/ chmod it as root, then go hard
xd