Differences
This shows you the differences between two versions of the page.
linux_wiki:smb_provide_network_shares_suitable_for_group_collaboration [2018/05/19 15:07] billdozor [Group Shares: Client] |
linux_wiki:smb_provide_network_shares_suitable_for_group_collaboration [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== SMB Provide Network Shares Suitable For Group Collaboration ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Samba shares for groups. | ||
- | |||
- | **Prerequisites** | ||
- | * [[linux_wiki: | ||
- | * [[linux_wiki: | ||
- | |||
- | ---- | ||
- | |||
- | ====== Lab Setup ====== | ||
- | |||
- | The following virtual machines will be used: | ||
- | * server1.example.com (192.168.1.150) -> Perform all SMB client tests from here | ||
- | * server2.example.com (192.168.1.151) -> Install the Samba Server here | ||
- | |||
- | ---- | ||
- | |||
- | ====== Group Shares: Server ====== | ||
- | |||
- | Create a group | ||
- | <code bash> | ||
- | groupadd smbgrp | ||
- | </ | ||
- | |||
- | \\ | ||
- | Add users to the group | ||
- | <code bash> | ||
- | usermod -G smbgrp user1 | ||
- | usermod -G smbgrp user2 | ||
- | </ | ||
- | |||
- | \\ | ||
- | Create samba passwords | ||
- | <code bash> | ||
- | smbpasswd -a user1 | ||
- | smbpasswd -a user2 | ||
- | </ | ||
- | |||
- | \\ | ||
- | Setup the group directory for sharing | ||
- | <code bash> | ||
- | mkdir / | ||
- | chown :smbgrp / | ||
- | chmod 770 / | ||
- | </ | ||
- | |||
- | \\ | ||
- | SELinux: Set file context | ||
- | <code bash> | ||
- | semanage fcontext -at samba_share_t "/ | ||
- | restorecon -Rv / | ||
- | </ | ||
- | |||
- | \\ | ||
- | Create the new directory share config | ||
- | <code bash> | ||
- | vim / | ||
- | |||
- | [sambashare_group] | ||
- | | ||
- | path = / | ||
- | valid users = @smbgrp | ||
- | write list = @smbgrp | ||
- | | ||
- | force group = +smbgrp | ||
- | | ||
- | |||
- | # Defaults, but listing in case something in [global] over rides | ||
- | | ||
- | | ||
- | </ | ||
- | * +smbgrp | ||
- | |||
- | \\ | ||
- | Restart the service for changes to take effect | ||
- | <code bash> | ||
- | systemctl restart smb | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ====== Group Shares: Client ====== | ||
- | |||
- | Ensure the same users and group exist on the client | ||
- | * **uids and gids must match!** | ||
- | |||
- | \\ | ||
- | List shares | ||
- | <code bash> | ||
- | smbclient -L // | ||
- | </ | ||
- | |||
- | \\ | ||
- | Setup local directory for mounting the remote samba share | ||
- | <code bash> | ||
- | mkdir / | ||
- | </ | ||
- | |||
- | \\ | ||
- | Mount Persistently | ||
- | <code bash> | ||
- | vim / | ||
- | |||
- | username=user1 | ||
- | password=password | ||
- | |||
- | |||
- | vim /etc/fstab | ||
- | |||
- | // | ||
- | </ | ||
- | |||
- | ---- | ||