linux_wiki:smb_provide_network_shares_suitable_for_group_collaboration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux_wiki:smb_provide_network_shares_suitable_for_group_collaboration [2016/09/02 22:09]
billdozor created
linux_wiki:smb_provide_network_shares_suitable_for_group_collaboration [2019/05/25 23:50] (current)
Line 6: Line 6:
  
 **Prerequisites** **Prerequisites**
-  * [[linux_wiki:smb_provide_network_shares_to_specific_clients|Samba server installed and configured]] +  * [[linux_wiki:smb_provide_network_shares_to_specific_clients#server_install_and_config|Samba server installed and configured]] 
-  * [[linux_wiki:smb_provide_network_shares_to_specific_clients|Samba client installed and configured]]+  * [[linux_wiki:smb_provide_network_shares_to_specific_clients#client_install_and_config|Samba client installed and configured]] 
 + 
 +---- 
 + 
 +====== 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
  
 ---- ----
Line 23: Line 31:
 usermod -G smbgrp user1 usermod -G smbgrp user1
 usermod -G smbgrp user2 usermod -G smbgrp user2
 +</code>
 +
 +\\
 +Create samba passwords
 +<code bash>
 +smbpasswd -a user1
 +smbpasswd -a user2
 </code> </code>
  
Line 28: Line 43:
 Setup the group directory for sharing Setup the group directory for sharing
 <code bash> <code bash>
-mkdir /smbgroupshare +mkdir /sambashare_group 
-chown :smbgrp /smbgroupshare +chown :smbgrp /sambashare_group 
-chmod 770 /smbgroupshare+chmod 770 /sambashare_group
 </code> </code>
  
Line 36: Line 51:
 SELinux: Set file context SELinux: Set file context
 <code bash> <code bash>
-semanage fcontext -at samba_share_t "/smbgroupshare(/.*)?" +semanage fcontext -at samba_share_t "/sambashare_group(/.*)?" 
-restorecon -Rv /smbgroupshare+restorecon -Rv /sambashare_group
 </code> </code>
  
Line 45: Line 60:
 vim /etc/samba/smb.conf vim /etc/samba/smb.conf
  
-[smbgroup+[sambashare_group
- comment = /smbgroupshare + comment = My Groups Samba Share 
- browsable = yes + path = /sambashare_group
- path = /smbgroupshare +
- public = no+
  valid users = @smbgrp  valid users = @smbgrp
  write list = @smbgrp  write list = @smbgrp
  writable = yes  writable = yes
  force group = +smbgrp  force group = +smbgrp
- create mask = 0770+ create mask = 0664 
 + directory mask = 0775 
 + 
 + # Defaults, but listing in case something in [global] over rides 
 + browsable = yes 
 + public = no
 </code> </code>
 +  * +smbgrp  -> The "+" means that only users already in the group (smbgrp) will use that as their primary group when accessing the share.
  
 \\ \\
Line 67: Line 86:
 ====== Group Shares: Client ====== ====== Group Shares: Client ======
  
-  * Ensure the same users and group exist on the client +Ensure the same users and group exist on the client 
-    * uids and gids must match!+  * **uids and gids must match!**
  
 \\ \\
Line 83: Line 102:
  
 \\ \\
-Mount temporarily+Mount Persistently
 <code bash> <code bash>
-mount //192.168.1.200/smbgroupshare /collaborate -t cifs -o username=user1+vim /root/.sharedcreds 
 +  
 +username=user1 
 +password=password 
 + 
 + 
 +vim /etc/fstab 
 +  
 +//192.168.1.200/smbgroupshare /collaborate  cifs _netdev,rw,credentials=/root/.sharedcreds,uid=1004,gid=1004  0 0
 </code> </code>
  
 ---- ----
  
  • linux_wiki/smb_provide_network_shares_suitable_for_group_collaboration.1472868587.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)