Configuring SMB shares for groups is very similar to sharing for an individual. The only gotcha here is making sure security on the folder are set properly.
Scenario: You have a group named group1, users foo and bar are members of this group. You need to share a directory named /group1 to these users only.
- Install samba
- yum install samba-client samba-common samba
- Configure the /etc/samba/samba.conf file
- Find the line workgroup and set the correct workgroup name
- At the end of the file, create a new directory block using the same syntax as the others. Note the use of the +group1 for valid users, this identifies it as a group instead of a user
- #group1
- [group1]
- path = /group1
- writeable = yes
- browseable = yes
- valid users = +group1
- Save the file and restart the services — service smb restart, service nmb restart
- Ensure the folder being shared is owned by the group
- chown root:group1 /group1
- Ensure the file permissions allow the group to read/write
- chmod 775 /group1 -R
2 thoughts on “SMB — Provide network shares suitable for group collaboration”
If SELinux is enabled, you will need to label /group1 with samba_share_t using semanage.
Otherwise, the group will be denied access.
Group collaboration also implies setting the SETGID bit on the top directory.
So the chmod command would be
chmod 2775 /group1 -R