Samba Share

installed the server

to start

systemctl start smb.service

had major headaches due to selinux. prev smb.conf config to user /home/deleteme/public_share doesn't work

selinux can allow home dirs to be share by setting policy:

setsebool -P samba_enable_home_dirs on

setsebool -P samba_enable_home_dirs 1 // both are same

however, anon access to public wasn't working.

REF: http://www.redhat.com/archives/rhl-list/2006-April/msg02624.html

forget the home dir business...we want a public repository. fedora recommends to use /srv top level dir.

mkdir /srv/public

ALSO recommended by http://selinuxproject.org/page/SambaRecipes

chcon -Rt public_content_rw_t /srv/public

then to allow smb to access the /srv/public :

setsebool -P allow_smbd_anon_write=1

make the change context permanent:

semanage fcontext -a -t public_content_rw_t "/srv/public(/.*)?"

restorecon -R -v /srv/public/

to check the selinux context of a dir:

ls -ltZ <dir/filename>

[root@shoonya srv]$ ls -ltZ /srv

drwxr-xr-x. root root unconfined_u:object_r:public_content_rw_t:s0 public

Now some pissing w/ smb.conf.

again some changes ref to:

http://vicidi.wordpress.com/2012/01/23/set-up-samba-without-using-deprecated-share-security-setting/

http://ubuntuforums.org/showthread.php?t=1962617

the issue was that security=share has been depreceated. now it's security=user. thus have to add

security = user

map to guest = Bad User

guest ok = yes

to the [global] section.

to the local Public folder declaration:

[Not4U]

comment = Public Folder

path = /srv/public

public = yes

writable = yes

only guest = yes

browsable = yes

read only = No

========== FUCKING HELL..... simple LINUX file permission.... issue

chmod ugo+rwx /srv/public

chmod go+rw <editable_filename>

VOILA