I've got minimal experience with linux systems, I need to test a web page in the environment its going to be hosted in so I set up a test server and tried to use samba for convenient access to the hosted files.
So far what I've done is:
- minimal CentOS 7 install
- installed apache, mysql, php, nano and samba
- enabled and started the services for all of those where applicable
- let apache and samba through the firewall
- adduser --system samba_user
- chown -R samba_user /var/www/html
- chmod 777 for /var/www/html
- edited my smb.conf to look like this exactly:
[global] workgroup = WORKGROUP netbios name = test_server security = USER map to guest = bad user [html] path = /var/www/html public = yes browsable = yes writeable = yes read only = no create mask = 0777 directory mask = 0777 force user = samba_user
and restarted the samba service using systemctl restart smb.service (and after every smb.conf modification attempt in general)
It did not go in that neat order but rather with some hair pulling over several hours but that's what it essentially distills down to. I know I'm being overly generous with security permissions but I really need no security right now, I'll settle for it just working. The contents of smb.conf I pieced together from various guides/forum threads and sambas own documentation.
The whole apache/mysql/php works fine but every time I try to access the shared directory in my win 7 machine, it says I have no permission to access it.
I can see the test_server in network, I can even access it and see the html directory (after adding map to guest = bad user to smb.conf) but no matter what I try, I can't get into that folder.
I also tried these since it seemed to pop up a lot with other peoples win 7 samba access problems
lanman auth = no ntlm auth = no client ntlmv2 auth = yes
but removed those lines since according to samba documentation, those are the default values anyway
I also edited win 7 security policies to enable ntlm and plaintext passwords but no effect for either.
Is there anything I'm missing? Anything else to try?
Turns out it was SELinux denying samba access to /var/www/html, found some options to deal with it here: https://serverfault.com/questions/131105/how-do-i-get-selinux-to-allow-apache-and-samba-on-the-same-folder