Avatar of Mccalma1
Mccalma1

asked on 

Need help with setting group permissions on a folder in linux

Hi,

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....
Linux SecurityIT AdministrationLinux

Avatar of undefined
Last Comment
simon3270
ASKER CERTIFIED SOLUTION
Avatar of Seth Simmons
Seth Simmons
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Mccalma1
Mccalma1

ASKER

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:
/media/raid/test_group      192.168.0.0/255.255.0.0(sync,insecure,no_subtree_check,insecure_locks,rw)

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?
Avatar of Mccalma1
Mccalma1

ASKER

I just noticed your last line regarding umask. How do I do that?

Like this???
umask 002 test_group
Avatar of Seth Simmons
Seth Simmons
Flag of United States of America image

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
Avatar of Seth Simmons
Seth Simmons
Flag of United States of America image

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)

http://snap.nlc.dcccd.edu/reference/sysadmin/julian/ch18/395-398.html
Avatar of Mccalma1
Mccalma1

ASKER

The umask was already set for 002. It's still not working properly on the Solaris client.
SOLUTION
Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Mccalma1
Mccalma1

ASKER

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?
Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of Mccalma1
Mccalma1

ASKER

Thanks for your help Simon, I really appreciate it!
Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

No problem, and thanks for the points!
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo