Centos – Samba server on CentOS sees shared directories, but no files visible

centosfreebsdsamba

I have a very basic samba share for a development environment. There is a directory /var/www/ owned by www:www. All subdirectories are also owned by www:www. All users are members of the www group. The entire smb.conf file is the default except for the share definition.

[www]
  path = /usr/share/nginx/www/
  public = yes
  writable = yes
  create mask = 0775

I can see the directory structure from windows, but all directories shown as empty. This config works in FreeBSD perfectly. Any ideas?

After getting to the office, I ran wireshark and on the QUERY_PATH_INFO request, I get back STATUS_OBJECT_NAME_NOT_FOUND, over and over again.

I moved the webroot back to the nginx default of /usr/share/nginx, and this for whatever reason solved the browsing problem, but my user now doesn't have permission to write to the directory. If it isn't one thing it's another.

Best Answer

As told above, try first:

# setenforce 0

if the files appear, then it's a SELinux missing context. Enable SELinux again, then add context to folder:

# setenforce 1
# chcon -Rt samba_share_t /usr/share/nginx/www/