Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there such a thing as a normal root and a real root in Unix/Linux?

I am doing a buffer overflow project (in Ubuntu 11.04) and I invoke /bin/zsh and /bin/bash separately. In both cases

$whoami returns root

$id returns uid=1000, euid=0, gid=1000.

But, when I try to run

$passwd username

to change some user's password, the shell returns:

passwd: You may not view or modify password information for username

Is there something that I am missing here as I believe this is root does not have low level privileges. I have searched all over the net, but I don't seem to find a comprehensive answer.

share|improve this question

migrated from stackoverflow.com Oct 18 '11 at 4:13

This question came from our site for professional and enthusiast programmers.

    
Also, I forgot to mention, commands such as $useradd, $userdel, $chown work without any elevation – Suchit Oct 18 '11 at 4:31

Do you mean "real UID / GID" vs "effective UID / GID" ..?

real UID : this is the UID of the process that created THIS process - e.g. as who you logged in.

effective UID: This UID is used to evaluate privileges of the process to perform actions.

you should check here:

http://www.lst.de/~okir/blackhats/node23.html

http://mahmudonline.com/?p=278

http://en.wikipedia.org/wiki/Setuid

http://en.allexperts.com/q/Unix-Linux-OS-1064/real-effective-user-id.htm


EDIT:

Just found this page, which has a nice description:

http://bashscript.blogspot.com/2010/03/unixlinux-advanced-file-permissions.html

share|improve this answer
    
Thanks for your reply I understand what real and effective UID/GID mean, but my question is why does the real UID not become zero when I invoke /bin/bash or /bin/zsh from some buffer overflow vulnerable program? Rather effective UID is made zero. I forgot to mention that my motive is to obtain real UID to be zero without running a separate shell code that sets real uid = 0 (with setuid(0)). – Suchit Oct 18 '11 at 4:29
    
@Suchit: If that is what your question is, you could either update your question or ask a new one. – RedGrittyBrick Oct 18 '11 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .