Samba: Difference between revisions
From KlavoWiki
Jump to navigationJump to search
No edit summary |
|||
Line 1: | Line 1: | ||
= Installation = | = Installation = | ||
The following will allow a Windows computer to connect to the Samba shares as anonymous without authentication. | |||
<pre> | <pre> | ||
yum install samba | yum install samba | ||
</pre> | </pre> | ||
<pre> | |||
systemctl enable smb | |||
</pre> | |||
= Configuration = | |||
== Globals == | |||
<pre> | <pre> | ||
vi /etc/samba/smb.conf | |||
</pre> | </pre> | ||
<pre> | |||
workgroup = WORKGROUP | |||
server string = My Media Server | |||
netbios name = centos | |||
</pre> | |||
<pre> | |||
security = user | |||
passdb backend = tdbsam | |||
map to guest = bad user | |||
</pre> | |||
<pre> | |||
load printers = no | |||
</pre> | |||
== File Shares == | |||
<pre> | |||
[alpha] | |||
path = /mnt/usb-hd0/alpha | |||
comment = Alpha File Share | |||
public = yes | |||
browseable = yes | |||
writable = yes | |||
guest ok = yes | |||
read only = no | |||
[beta] | |||
path = /mnt/usb-hd0/beta | |||
comment = Beta File Share | |||
public = yes | |||
browseable = yes | |||
writable = yes | |||
guest ok = yes | |||
read only = no | |||
</pre> | |||
== File Permissions == | |||
As with a Windows computer there are two aspects to file sharing. The share permission and the file permission.<br><br> | |||
File Permissions | |||
<pre> | <pre> | ||
chmod -R 757 /path/to/folder | |||
</pre> | </pre> | ||
Set Folder Owner to nobody | |||
<pre> | <pre> | ||
chmod -R nobody:nobody /path/to/folder | |||
</pre> | </pre> | ||
= | = Services = | ||
Once the file has been saved restart the service. | |||
<pre> | <pre> | ||
systemctl restart smb | |||
</pre> | </pre> | ||
= Connecting to Windows UNC = | |||
If you require to mount to a UNC then you will also need to install the samba-client. | If you require to mount to a UNC then you will also need to install the samba-client. | ||
<pre> | <pre> |
Revision as of 05:30, 20 June 2015
Installation
The following will allow a Windows computer to connect to the Samba shares as anonymous without authentication.
yum install samba
systemctl enable smb
Configuration
Globals
vi /etc/samba/smb.conf
workgroup = WORKGROUP server string = My Media Server netbios name = centos
security = user passdb backend = tdbsam map to guest = bad user
load printers = no
[alpha] path = /mnt/usb-hd0/alpha comment = Alpha File Share public = yes browseable = yes writable = yes guest ok = yes read only = no [beta] path = /mnt/usb-hd0/beta comment = Beta File Share public = yes browseable = yes writable = yes guest ok = yes read only = no
File Permissions
As with a Windows computer there are two aspects to file sharing. The share permission and the file permission.
File Permissions
chmod -R 757 /path/to/folder
Set Folder Owner to nobody
chmod -R nobody:nobody /path/to/folder
Services
Once the file has been saved restart the service.
systemctl restart smb
Connecting to Windows UNC
If you require to mount to a UNC then you will also need to install the samba-client.
yum -y install samba-client cifs-utils
If you do not have the samba client installed you will get errors like:
CIFS VFS: cifs_mount failed w/return code = -22