linux_wiki:smb_provide_network_shares_to_specific_clients

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:smb_provide_network_shares_to_specific_clients [2018/04/16 01:01]
billdozor [Server Install and Config]
linux_wiki:smb_provide_network_shares_to_specific_clients [2019/05/25 23:50] (current)
Line 81: Line 81:
 SELinux: Find samba boolean settings SELinux: Find samba boolean settings
 <code bash> <code bash>
-getsebool -a | grep samba_export +getsebool -a | grep samba
-getsebool -a | grep samba_share_nfs+
 </code> </code>
  
Line 96: Line 95:
 <code bash> <code bash>
 vim /etc/samba/smb.conf vim /etc/samba/smb.conf
 +
 +# Only listing items to change/add
  
 [global] [global]
-Workgroup = MYLABSERVER +# add hosts allow if needing to limit host access by IP
-server string = 192.168.1.200+
 hosts allow = 127.  192.168.1.10 hosts allow = 127.  192.168.1.10
 +# add interfaces to limit where it is listening
 interfaces = lo eth0 192.168.1 interfaces = lo eth0 192.168.1
-passdb backend = smbpasswd 
-security = user 
-log file = /var/log/samba/%m.log 
-max log size = 5000 
  
 +# create new share; base off of other default entries
 [sambashare_public] [sambashare_public]
 comment = /sambashare_public comment = /sambashare_public
Line 117: Line 115:
 </code> </code>
   * [global] -> global samba settings   * [global] -> global samba settings
-    * Workgroup  -> Can be domain or should match Windows workgroup if needing to share with Windows systems 
-    * server string  -> IP of the samba server itself 
     * hosts allow  -> Hosts that are allowed to access     * hosts allow  -> Hosts that are allowed to access
     * interfaces  -> samba binds to these interfaces or IPs     * interfaces  -> samba binds to these interfaces or IPs
-    * passdb backend  -> password to backend database (for users enabled) 
-    * security  -> user security set 
   * [sambashare_public]  -> Share name   * [sambashare_public]  -> Share name
     * comment -> Can be anything descriptive     * comment -> Can be anything descriptive
Line 131: Line 125:
     * write list  -> users that can write to the share     * write list  -> users that can write to the share
     * writable  -> enable write to the share     * writable  -> enable write to the share
 +
 +\\
 +**Config File Help**<code bash>vim /etc/samba/smb.conf.example
 +And
 +man smb.conf</code>
  
 \\ \\
Line 165: Line 164:
 yum install samba-client cifs-utils yum install samba-client cifs-utils
 </code> </code>
 +
 +\\
 +Create the same user on the client that will own the share<code bash>useradd -s /sbin/nologin user1</code>
  
 \\ \\
Line 176: Line 178:
 <code bash> <code bash>
 mkdir /sharedrive mkdir /sharedrive
-</code> 
- 
-\\ 
-Mount temporarily 
-<code bash> 
-mount //192.168.1.200/sambashare /sharedrive -t cifs -o username=user1,uid=1004,gid=1004 
 </code> </code>
  
Line 194: Line 190:
  
 \\ \\
-Ensure restrictive permissions+Mount persistently: Ensure restrictive permissions
 <code bash> <code bash>
 chown root:root /root/.sharedcreds chown root:root /root/.sharedcreds
Line 206: Line 202:
  
 //192.168.1.200/sambashare  /sharedrive  cifs _netdev,rw,credentials=/root/.sharedcreds,uid=1004,gid=1004  0 0 //192.168.1.200/sambashare  /sharedrive  cifs _netdev,rw,credentials=/root/.sharedcreds,uid=1004,gid=1004  0 0
 +</code>
 +
 +\\
 +Mount persistently: mount all
 +<code bash>
 +mount -a
 </code> </code>
  
 ---- ----
  
  • linux_wiki/smb_provide_network_shares_to_specific_clients.1523854914.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)