Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:smb_provide_network_shares_to_specific_clients [2016/10/08 18:01] billdozor |
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 | + | |
</ | </ | ||
Line 93: | Line 92: | ||
\\ | \\ | ||
- | Edit samba configuration file | + | Edit samba configuration file (Example) |
<code bash> | <code bash> | ||
vim / | vim / | ||
+ | |||
+ | # 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 = / | ||
- | max log size = 5000 | ||
+ | # create new share; base off of other default entries | ||
[sambashare_public] | [sambashare_public] | ||
comment = / | comment = / | ||
Line 117: | Line 115: | ||
</ | </ | ||
* [global] -> global samba settings | * [global] -> global samba settings | ||
- | * Workgroup | ||
- | * server string | ||
* hosts allow -> Hosts that are allowed to access | * hosts allow -> Hosts that are allowed to access | ||
* interfaces | * interfaces | ||
- | * passdb backend | ||
- | * security | ||
* [sambashare_public] | * [sambashare_public] | ||
* comment -> Can be anything descriptive | * comment -> Can be anything descriptive | ||
Line 133: | Line 127: | ||
\\ | \\ | ||
- | Test samba config syntax | + | **Config File Help**< |
+ | And | ||
+ | man smb.conf</ | ||
+ | |||
+ | \\ | ||
+ | [Optional] | ||
<code bash> | <code bash> | ||
testparm | testparm | ||
Line 139: | Line 138: | ||
\\ | \\ | ||
- | Display information from SAM (samba) database | + | [Optional] |
<code bash> | <code bash> | ||
pdbedit -Lv | pdbedit -Lv | ||
Line 165: | Line 164: | ||
yum install samba-client cifs-utils | yum install samba-client cifs-utils | ||
</ | </ | ||
+ | |||
+ | \\ | ||
+ | Create the same user on the client that will own the share< | ||
\\ | \\ | ||
Line 176: | Line 178: | ||
<code bash> | <code bash> | ||
mkdir /sharedrive | mkdir /sharedrive | ||
- | </ | ||
- | |||
- | \\ | ||
- | Mount temporarily | ||
- | <code bash> | ||
- | mount // | ||
</ | </ | ||
Line 194: | Line 190: | ||
\\ | \\ | ||
- | Ensure restrictive permissions | + | Mount persistently: |
<code bash> | <code bash> | ||
chown root:root / | chown root:root / | ||
Line 206: | Line 202: | ||
// | // | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Mount persistently: | ||
+ | <code bash> | ||
+ | mount -a | ||
</ | </ | ||
---- | ---- | ||