9

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.

5
  • Check your samba log and audit logs. Sep 2, 2014 at 13:00
  • What are the permission of the files (not the directories)? Also, on CentOS, Apache usually works as user/group apache, not www.
    – Sven
    Sep 2, 2014 at 13:00
  • All of the files and directories are owned by www:www, and the logs don't show anything of consequence, a few errors from the windows machine attempting to reload the directory before it was configured, and some errors regarding printers, which are enabled in the default config, but I'm not using. I'm on nginx, but it's configured to run as www, it's a holdover from FreeBSDwhere the default user is www.
    – Peter
    Sep 2, 2014 at 14:04
  • 2
    Try setenforce 0 and see if it's SELinux-related.
    – MadHatter
    Sep 2, 2014 at 14:58
  • That's in /etc/grub.conf, no?
    – Peter
    Sep 2, 2014 at 16:06

1 Answer 1

18

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/
1
  • 2
    When something strange goes wrong one has to be vigilant about remembering about SELinux.
    – gak
    Mar 17, 2016 at 0:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .