The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
doubt in awk jisha Shell Programming and Scripting 4 04-16-2008 01:02 AM
doubt about awk soujanya_srk UNIX for Dummies Questions & Answers 2 01-10-2008 01:26 PM
Pls help for the doubt ravi.sadani19 Shell Programming and Scripting 4 04-12-2007 01:51 AM
doubt in sed matrixmadhan UNIX for Dummies Questions & Answers 3 08-03-2005 08:34 AM
doubt it sed esham Shell Programming and Scripting 2 03-07-2005 09:52 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2005
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,404
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
strange doubt in users

confused with this strange doubt

abc is my login id

ls -l | grep abc
drwxr-xr-x 13 abc req 1024 Jun 21 22:50 abc

i just reset my group from req to try by changing the entry in /etc/passwd

but still
ls -l | grep abc
drwxr-xr-x 13 abc req 1024 Jun 21 22:50 abc
instead of try

strange thing is i have a program that would execute only if the group is try and now i am able to execute that (seems grp has been changed but i couldnt reflect the change in /users/ )

what could be the reason?

hope i make things clear
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-02-2005
Registered User
 

Join Date: Oct 2005
Posts: 50
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Is there anywhere else, for example in user, that you could change it or check it to see if its still req?
Reply With Quote
  #3 (permalink)  
Old 12-02-2005
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,404
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
now i tried

chgrp try /users/abc/
ls -l | grep abc
drwxr-xr-x 13 abc try 1024 Jun 21 22:50 abc

i have the effect of the above chgrp command only for /users/abc/ the file that i had specified in chgrp

but still
the file /users/abc/sub is in req group

could somebody help me with this?
Reply With Quote
  #4 (permalink)  
Old 12-02-2005
Registered User
 

Join Date: Oct 2005
Posts: 50
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
*i have never played with groups BUT* How hard/disasterous would it be to just go and delete the group and remake it. There has to be some script or something out there to collect the names of the users in the group then delete the group and put it back together. As i said i havent played with groups but just a thought.



Someone once said "The hardest problems are solved by the most obvious solutions, you just need someone else to tell you what it is."
Heh this is so true.....sometimes you get so frustrated you don't see the obvious.
Reply With Quote
  #5 (permalink)  
Old 12-02-2005
Registered User
 

Join Date: Nov 2003
Location: Minnesota
Posts: 379
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
There are a couple things going on here. First, when you change your group in /etc/password it changes which group you belong to, but that won't have any effect on files that are already created. From now on, all files you create will have group try, but anything from before won't change.

That is why in your second post you needed to do the chgrp. When you did the chgrp try /user/abc, that will change the group for JUST /user/abc. If you want it to change the group for everything below you need to tell the chgrp command that. In Solaris it would be:

chgrp -R try /user/abc

If you are using a different Unix version just check the manpage for chgrp to verify that the switch is -R for you as well.

Hope that clears it up for you.

Last edited by rhfrommn; 12-02-2005 at 08:10 AM. Reason: Added more information
Reply With Quote
  #6 (permalink)  
Old 12-04-2005
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,404
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Thats very true,

after changing the group in /etc/passwd
all the files hence forth created will have the current group
and not the older ones

Assumed when group is changed for a user the home directory of the user which in turns contain an unique inode, would change its group name based on the group id identified from the file.

Wouldn't the contents of the inode(group name) be refreshed with the current one?
Would appreciate very much if somebody explains at the level of inodes?

Thanks,
Mad
Reply With Quote
  #7 (permalink)  
Old 12-05-2005
Registered User
 

Join Date: Nov 2003
Location: Minnesota
Posts: 379
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Looking at the inode level doesn't really change things. The filesystem stores information about the file including the numeric group ID for it in an inode. But that still isn't linked to the user account in a "live" fashion. Once the file is created the information is set. You can change the default group for the owner, but the file (and the inode) still doesn't know about that. You need to use a command like chmod or chgrp to edit that information.

You could use switches on an ls command to get more information about this. Maybe making a test account, homedir, and some files then playing around with it would help make it more clear. For example, in solaris ls -n will print the numeric group and user IDs instead of the names of the group and user. Also -i will print the inode number as part of the long listing.

I'm not sure if that answers your question, but I think it should.
Reply With Quote
  #8 (permalink)  
Old 12-12-2005
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,404
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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?
Reply With Quote
  #9 (permalink)  
Old 12-13-2005
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 923
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
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
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101