Need help with setting group permissions on a folder in linux


I need to setup a folder with the following requirements.

Folder name:             test_group
Member of Group:    test_group

Only members of group "test_group" can write to folder "test_group".
Currently it's not working as planned. For example: userX and userY are members of tes_group. If userX creates a file in the test_group directory, then userY should be able to edit and save that file. In my current setup, userY can not edit the file as a permissions error pops up.

My permissions on folder test_group are setup as follows:
drwxr-xr-x  2 5001 test_group  4096 Sep 11 09:41 test_group

 This should be easy, but I'm struggling for some reason....
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Seth SimmonsSr. Systems AdministratorCommented:
looks at the permissions - the owner is rwx but group is r-x which is why userY can't write to it

change the permission on the file and/or folder with chmod g+w

also, to make permanent, set the umask value to 002 so that files are created as rwxrwxr-x so other group members can write

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mccalma1Author Commented:
I made the change and now it works properly on the Linux server, but does not work on the Solaris 10 client.

Here are the new settings on the server:
drwxrwxr-x   2    5001 test_group       4096 Sep 12 11:38 test_group

The test_group folder is exported via NFS.

Here is what is in /etc/exports on the linux server:

I suspected that the Solaris computer was not recognizing the group, so I typed the following:
"ypcat group.byname | grep test_group" and the following was displayed, "test_group::510:userX,userY", so it should recognize the group.
 I'm not sure what to look at next?
Mccalma1Author Commented:
I just noticed your last line regarding umask. How do I do that?

Like this???
umask 002 test_group
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Seth SimmonsSr. Systems AdministratorCommented:
just umask 022
you can put it for either all users in /etc/profile or (if the user is using bash) put in their ~/.bashrc file
Seth SimmonsSr. Systems AdministratorCommented:
i've done little with solaris but a quick look doesn't seem to be that different; the profile file is different though (scroll about half way down)
Mccalma1Author Commented:
The umask was already set for 002. It's still not working properly on the Solaris client.
The group data is stored as a number (the group ID) in the directory.  Are the group IDs of test_group the same on both boxes?  Run the "id" command on the same user on both machines, and check that the number printed after the test_group entry (or before, on Solaris) is the same.
Mccalma1Author Commented:
I think you may have nailed the problem Simon!

The GID name and number shows up as expected on the server. The users are a member of their own group which is their username and a member of the test_group.

On the Solaris computer, only their own group shows up. How do I get the Solaris computer to recognize secondary groups?
If the computers are sharing a disk, rather than a user database, you'll have to add the group manually on the Solaris box (with the same numeric GID as on the other one), then manually add the users to that group.
    sudo groupadd -g 123 test_group
    sudo usermod -G +test_group user_name
then log out and in again as that user "user_name".  the "id -a" command should then show membership of the correct group, with the right numeric ID.
Mccalma1Author Commented:
Thanks for your help Simon, I really appreciate it!
No problem, and thanks for the points!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Security

From novice to tech pro — start learning today.