Suppose the following setup:
- VPN: VPN server (docker + openVPN)
- FS: File storage (cifs share)
- Application, Load Balancer, Database, ...
Both servers are root access ubuntu server virtual machines hosted in some third party company.
When the php7 app writes to CIFS share, I get Permission denied error.
All files on share (as checked and set on APP server) are
chmod 777 and
chown www-data which is the php-fpm user.
When i open the website via VPN, there is no such error, all changes are OK.
I was able to narrow the error down to the file system layer. The CIFS share is not accessible from other servers when not connected via VPN.
I'm guessing this has something to do with the
iptables config. Though I ran
iptables -F to disable the firewall, no help.
I might have misconfigured the nginx to pass along the User's IP onto the CIFS.
root@filestore:~# iptables -L -n
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
#======================= Share Definitions ======================= [static-fs] path = /home/storage/ browsable = yes guest ok = no writeable = yes create mask = 0777 valid users = storage write list = storage
root@ubuntuVM:~# smbclient -L \\filestore -U storage Connection to filestore failed (Error NT_STATUS_IO_TIMEOUT) root@ubuntuVM:~# ping filestore PING filestore (18.104.22.168) 56(84) bytes of data. 64 bytes from xxx.ip-22.214.171.124.eu (126.96.36.199): icmp_seq=1 ttl=52 time=24.2 ms ...
It's not a DNS problems, the domains are valid and I have the same problems using IPs.