Pages

May 20, 2007

Minimal smb.conf for Linux

This tip is for setting up anonymous share using samba 3 under Linux with really minimal smb.conf. I assume you want to share directory /data read only. For sharing it read-write, make sure it has correct permissions (chmod 777 /data) and uncomment last line :-)
cat /etc/samba/smb.conf
[global]
 netbios name = darkstar
 server string = darkstar
 guest ok = yes
 security = share
[data]
 path = /data
# read only = no

Edit in 2016: For Fedora 23, you need to change this config for

cat /etc/samba/smb.conf
[global]
 netbios name = darkstar
 server string = darkstar
 guest ok = yes
 security = user
 map to guest = bad user
[data]
 path = /data
# read only = no


Also you need to change selinux fcontext of shared directory:

# semanage fcontext -a -t samba_share_t  "/data(/.*)?"
# restorecon -Rv /data
### this third line may be needed if /data is managed by local user
# setsebool -P samba_enable_home_dirs 1

No comments:

Post a Comment