strange doubt in users


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers strange doubt in users
# 1  
Old 12-02-2005
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
# 2  
Old 12-02-2005
Is there anywhere else, for example in user, that you could change it or check it to see if its still req?
# 3  
Old 12-02-2005
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?
# 4  
Old 12-02-2005
*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.
# 5  
Old 12-02-2005
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 12:10 PM.. Reason: Added more information
# 6  
Old 12-05-2005
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
# 7  
Old 12-05-2005
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.
 
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