Hello Gurus,
I just started Unix, i am neither a student nor a proffessional.
i just completed my masters degree and looking for a career in Unix/Linux.
so i will be preparing for myself with the help of different forum's guru's.
i just completed the os basics and going through baiscs of unix.
according to the knowledge i got from books a user ID is used for each user of the Unix as unix is a multiuser operating system.
but what for this effective UID?
group id for a group of people working under the same project.
whats this effective group id.
i have read the effective user id , but didnt understand it completely and its relation with setuserid.
please help me.
i am using richard stevens
thanks
google .... and following seems useful.
Real and Effective IDs
thank you very much geek ,
your post was so help full.
i have gone through that and i understood well about the effective Ids.
but i have a confusion regarding setuid().
please correct following:
setuid is used by the process to gain access to the other users resources
by setting effective user id of the process to resource owner's id.
but ,
-
how the process determines which resources it can access, which uids it can set.
-
can a process set the euid of root to any other process.
getting the root privilliges to the normal process.
Thanks,
I hope the following experimentation can guide you better.,
- C program for showing the EUID usage.
$ cat t.c
#include <stdio.h>
int main()
{
printf ("My UID: %d\n",getuid());
printf ("My EUID: %d\n",geteuid());
}
- Compile it
$ cc t.c
- Execute it
$ ./a.out
My UID: 1000
My EUID: 1000
- Change the owner to root, and set userid.
$ sudo chown root:root a.out
$ sudo chmod u+s a.out
$ ls -l a.out
-rwsr-xr-x 1 root root 8373 2009-11-09 18:52 a.out
- Execute the program as normal user, so user id is 1000, and euid is 0.
$ ./a.out
My UID: 1000
My EUID: 0