Beginner:user ID's and group ID's

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Beginner:user ID's and group ID's
# 1  
Old 11-09-2009
Beginner:user ID's and group ID's

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

# 2  
Old 11-09-2009
google .... and following seems useful.

Real and Effective IDs
# 3  
Old 11-09-2009
Originally Posted by thegeek
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 ,
1. how the process determines which resources it can access, which uids it can set.

2. can a process set the euid of root to any other process.
getting the root privilliges to the normal process.

# 4  
Old 11-09-2009
I hope the following experimentation can guide you better.,

1. 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());

2. Compile it
$ cc t.c

3. Execute it
$ ./a.out 
My UID: 1000
My EUID: 1000

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

5. Execute the program as normal user, so user id is 1000, and euid is 0.
$ ./a.out 
My UID: 1000
My EUID: 0

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

User is a Part of a Group But Group Details Do Not Show the User

Hi, In the following output you can see the the user "richard" is a member on the team/group "developers": # id richard uid=10247(richard) gid=100361(developers) groups=100361(developers),10053(testers) but in the following details of the said group (developers), the said user... (3 Replies)
Discussion started by: indiansoil
3 Replies

2. Shell Programming and Scripting

beginner scripting questions User variables

If there's anywhere to look this up, it would be just as helpful. I googled and really couldn't find anything relative to this. ok... General Variables 1) When creating a script I made a file "" does it matter if the end is .sh or is this what has to be done like prog.bash or... (4 Replies)
Discussion started by: austing5
4 Replies

3. Shell Programming and Scripting

user without group

hi i have vert strange query.. can we add user in unix with out assigned it to any group i mean user which is having no default group or anything.. like this in /etc/passwd file new_user:::::::: Please help (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

4. Debian


Can someone help in creating a group and user. syntax to create a Group called Members. syntax to create a user called AAAA and place in to the Group Members. Thanks for your help in Advance. (3 Replies)
Discussion started by: sawyer
3 Replies

5. Ubuntu

Create New User with the same group nd privileges of the other user

Hi, Anyone can help me on how to duplicate privileges and group for useroradb01 to userrootdb01. I have currently using "useroradb01" and create a newly user "userrootdb01". I want both in the sames privileges and group. Please see the existing users list below; drwxr-xr-x 53 useroradb01... (0 Replies)
Discussion started by: fspalero
0 Replies

6. Shell Programming and Scripting

user and its group

Hello, is there any command which can show a particular user "xyz" is belongs to how many groups thanks (3 Replies)
Discussion started by: lookinginfo
3 Replies

7. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies

8. UNIX for Dummies Questions & Answers

how can i add a user to a group

All, How i can add a user to a group so that the user will ahve all permsion on that directory . (sys12:pnl:/work/cn/>) groups crcv1 canusr and (sys12:pnl:/work/cn/>) groups pfmgr pfw users i am having the .ssh in the directory /work/cn/ which has permision as drwx------ . ... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

9. UNIX for Dummies Questions & Answers


Hi! Herez the scenario 1. logged in as user xxxx $ id uid=125(xxxx) gid=101(my_grp) groups=0(system),15(users),16(sysadmin),19(adm),110(appl) $ touch test $ ls -la test -rw-r--r-- 1 xxxx system 0 Mar 7 14:31 test Why is the group of the file test 'system' and not... (2 Replies)
Discussion started by: sdharmap
2 Replies

10. UNIX for Dummies Questions & Answers

User Group

I can't get a clear answer on this one... I have a Oracle user created in group 'dba' when this user touches a file the group displayed is 'sys' - why? The 'sys' group is not included in the list of secondary groups for this user. Is this standard to Oracle on Unix? (AIX) Anybody? (1 Reply)
Discussion started by: errolg
1 Replies
Login or Register to Ask a Question