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?
Seth SimmonsConnect With a Mentor Sr. 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
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
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

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.
simon3270Connect With a Mentor Commented:
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!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.