[CentOS] You have not permission to view content of this location

Thu Dec 8 16:30:05 UTC 2016
truename <dch12 at yeah.net>

Hi,

This works.

Thanks a lot. :D




At 2016-12-07 22:19:03, "Jonathan Billings" <billings at negate.org> wrote:
>On Wed, Dec 07, 2016 at 05:08:11PM +0800, truename wrote:
>> sudo chown u1 /data
>> sudo chgrp g1 /data
>> 
>> sudo chmod ugo+rwx /data
>> 
>> I edit /etc/samba/smb.conf:
>> 
>> [data]
>>     comment = data
>>     path = /data
>>     valid users = u1,u2
>>     write list = u1,u2
>>     create mask = 0777
>>     sync always = Yes
>> ;    hide dot files = yes
>> ;    writeable = no
>
>Out of curiosity, I ran:
>
># matchpathcon /data
>/data	system_u:object_r:etc_runtime_t:s0
>
>I'm not sure why /data is labeled etc_runtime_t, but I suspect that's
>why you can't export its contents via Samba, SELinux is probably
>preventing it.
>
>I suggest following the directions here:
>https://wiki.centos.org/HowTos/SetUpSamba#head-86233024cba06a1e4f554e763a2f634a61eae9b8
>
>and run:
>
>semanage fcontext -a -t samba_share_t '/data(/.*)?'
>restorecon -R /data
>
>-- 
>Jonathan Billings <billings at negate.org>
>_______________________________________________
>CentOS mailing list
>CentOS at centos.org
>https://lists.centos.org/mailman/listinfo/centos