Samba: Difference between revisions
From KlavoWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 68: | Line 68: | ||
<pre> | <pre> | ||
chmod -R nobody:nobody /path/to/folder | chmod -R nobody:nobody /path/to/folder | ||
</pre> | |||
Set defaults for new files | |||
<pre> | |||
setfacl -d -m g::rwx /path/to/folder | |||
</pre> | </pre> | ||
Line 78: | Line 83: | ||
= Connecting to Windows UNC = | = Connecting to Windows UNC = | ||
== Installation == | |||
<pre> | <pre> | ||
yum -y install samba-client cifs-utils | yum -y install samba-client cifs-utils | ||
</pre> | |||
== Mounting == | |||
<pre> | |||
mount -t cifs -o workgroup=workgroup,username=myuser,password=mypassword //my.server.name/sharename /tmp/smbmountpoint | |||
</pre> | </pre> | ||
Line 86: | Line 97: | ||
<pre> | <pre> | ||
CIFS VFS: cifs_mount failed w/return code = -22 | CIFS VFS: cifs_mount failed w/return code = -22 | ||
</pre> | |||
= Tools = | |||
Viewing Default Folder Permissions | |||
<pre> | |||
getfacl /folder/to/view | |||
</pre> | |||
Setting Default Permissions | |||
<pre> | |||
setfacl -d -m o::rwx /folder/to/set | |||
</pre> | </pre> | ||
[[Category: Linux]] | [[Category: Linux]] |
Revision as of 05:46, 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
Set defaults for new files
setfacl -d -m g::rwx /path/to/folder
Services
Once the file has been saved restart the service.
systemctl restart smb
Connecting to Windows UNC
Installation
yum -y install samba-client cifs-utils
Mounting
mount -t cifs -o workgroup=workgroup,username=myuser,password=mypassword //my.server.name/sharename /tmp/smbmountpoint
If you do not have the samba client installed you will get errors like:
CIFS VFS: cifs_mount failed w/return code = -22
Tools
Viewing Default Folder Permissions
getfacl /folder/to/view
Setting Default Permissions
setfacl -d -m o::rwx /folder/to/set