linux_wiki:smb_provide_network_shares_suitable_for_group_collaboration

This is an old revision of the document!


SMB Provide Network Shares Suitable For Group Collaboration

General Information

Samba shares for groups.

Prerequisites


Group Shares: Server

Create a group

groupadd smbgrp


Add users to the group

usermod -G smbgrp user1
usermod -G smbgrp user2


Setup the group directory for sharing

mkdir /smbgroupshare
chown :smbgrp /smbgroupshare
chmod 770 /smbgroupshare


SELinux: Set file context

semanage fcontext -at samba_share_t "/smbgroupshare(/.*)?"
restorecon -Rv /smbgroupshare


Create the new directory share config

vim /etc/samba/smb.conf
 
[smbgroup]
 comment = /smbgroupshare
 browsable = yes
 path = /smbgroupshare
 public = no
 valid users = @smbgrp
 write list = @smbgrp
 writable = yes
 force group = +smbgrp
 create mask = 0770


Restart the service for changes to take effect

systemctl restart smb

Group Shares: Client

  • Ensure the same users and group exist on the client
    • uids and gids must match!


List shares

smbclient -L //192.168.1.200 -U user1


Setup local directory for mounting the remote samba share

mkdir /collaborate


Mount temporarily

mount //192.168.1.200/smbgroupshare /collaborate -t cifs -o username=user1

  • linux_wiki/smb_provide_network_shares_suitable_for_group_collaboration.1472868587.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)