strange doubt in users


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers strange doubt in users
# 8  
Old 12-12-2005
group modification as i had thought - presumed to reflect the group name changes as and when a group is changed,
but as u had said it didn't

but managed to bring all the files (new one's and the existing ) under a single group

chgrp -R <newgroupname> ~user

but still to continue with the doubt,
sorry if i am churning out the same stuff.

how does the ls manages to list the files with the previous group name (the group to which the user currently doesnt belong) it was in

and no wonder how it lists the newly created files after the group change?
# 9  
Old 12-13-2005
When you create a file the filesystem evaluates your UID (say:4711) and your effective groups ID (say: group 0815) and now writes file xy. Basically the directory entry (the inode) states that user nr. 4711 (whatever his name is) and group 0815 (whatever its name is and whoever belongs to it) owns this file.

THIS INFORMATION NEVER CHANGES (until explicitly done so by chown, etc.).

If you delete your user now you will see that an "ls -l" shows a number instead of the name - the user nr of the deleted user account - and if you delete the group you would see a number instead of the groups name too - the file is still owned by user nr 4711 or group 0815, but this user and/or this group does not exist any more and therefore the ls command can't tell you who this should be.

If you create a new user with the same user nr as the old user (or a group with the same group nr as the old group) the file will belong to this new user or group - because now there there is a user 4711 (regardless of what his name is) again.

If you create a user or group with the same name as before but different UIDs (user numbers) the user/group won't own the file because exactly this connection is missing.

If you take an existing group/user and change its name the connection is still there - its done via the UID/GID and this is not affected by the name change. If you change the UID/GID this connection is broken and you do not own the file any more.

Clearer now?

bakunin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Doubt

in my shell script requirement is to search and replace the file with variable so i use the following command sed -i "s/abc/$SCHEMA/g" table.sql later when the script runs sqlplus username/pwd@Table& this & is not letting the variable to replace the value inside the file .please let me know... (1 Reply)
Discussion started by: bhuvan1
1 Replies

2. Shell Programming and Scripting

Create multiple users with individual passwords to users

hi, i am new to shell scripts i write a shell script to create multiple users but i need to give passwords to that users while creating users, command to write this script (1 Reply)
Discussion started by: DONFOX
1 Replies

3. Shell Programming and Scripting

Doubt..

Hi experts, In one of our code we have used some command like this. name=${name##*/} Can someone please let me know what exactly it does? Thanks & Regards, Sathya V. (1 Reply)
Discussion started by: Sathya83aa
1 Replies

4. Red Hat

Doubt

How to create a file with specific size in RHEL6 (1 Reply)
Discussion started by: Sashi Kanth A
1 Replies

5. Red Hat

Showing all users in 'users' and 'top' commands

Hi All, I work in a multi user environment where my school uses Red Hat Linux server. When I issue commands such as "top" or "users", I get to see what others are doing and what kinds of applications they are running (even ps -aux will give such information). "users" will let me know who else is... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Solaris

To restrict the users not to change the passwords for NIS users

Hi All, How to restrict the NIS users not to change their passwords in for NIS users?? and my NIS user is unable to login to at client location what could be the problem for this ? Any body can help me. Thanks in advance. (1 Reply)
Discussion started by: Sharath Kumar
1 Replies

7. UNIX for Dummies Questions & Answers

Doubt

Hi , Struck with one basic question. Iam expecting word count of 4 where "wc" is showing as 5 . # echo "abcd" | wc 1 1 5 # echo abcd | wc 1 1 5 (5 Replies)
Discussion started by: penchal_boddu
5 Replies

8. Shell Programming and Scripting

Doubt??

I jus want to know the meaning of the below command line(exclamation following that re-direction) sqlplus -s `cat /home/sample.txt` <<! Thanks!! (1 Reply)
Discussion started by: nohup
1 Replies
Login or Register to Ask a Question