[SOLVED] Samba: Empty directories on Windows!

Issues related to applications and software problems
Post Reply
tangozuluniner
Posts: 4
Joined: 2015/08/18 20:09:29

[SOLVED] Samba: Empty directories on Windows!

Post by tangozuluniner » 2015/08/25 21:45:06

Hello,

I am posting this here instead of the 'Networking' sub-forum. I hope this is the correct location. Mods, please move if necessary.

I have installed CentOS 7 as a guest OS in VirtualBox. My host OS is Windows 10. However, I can verify that a second Windows machine (running Vista) is behaving in the exact same manner. Here goes...

I can see my server in the 'Network' portion of Explorer and I can see my share (called 'test'). I am also able to enter the 'test' share, but it appears empty. On my CentOS server the directory is not empty. I am unable to write files to the 'test' share on the Windows side of things ('access denied').

Details:

sudo service smb status -l

Code: Select all

Redirecting to /bin/systemctl status -l smb.service
smb.service - Samba SMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled)
   Active: active (running) since Tue 2015-08-25 16:34:41 CDT; 15s ago
Main PID: 1290 (smbd)
   Status: "smbd: ready to serve connections..."
   CGroup: /system.slice/smb.service
                |-1290 /usr/sbin/smbd
                |-1376 /usr/sbin/smbd
                |-2442 /usr/sbin/smbd

Aug 25 16:34:41 centos7 smbd[1290]: [2015/08/25 16:34:41.834114, 0] ../lib/util
/become_daemon.c:136(daemon_ready)
Aug 25 16:34:41 centos7 systemd[1]: Started Samba SMB Daemon
Share definition from smb.conf:

Code: Select all

[test]
                comment = A Test Share
                path = /mnt/hello
                browseable = yes
                writable = yes
                guest ok = yes
I have also tried 'guest ok = no' and 'valid users = cody'.

I have created the 'cody' Samba user with 'smbpasswd -a cody' and given it a password.

I opened several ports with 'firewall-cmd':

Code: Select all

firewall-cmd --permanent --add-port=137/tcp
firewall-cmd --permanent --add-port=138/tcp
firewall-cmd --permanent --add-port=139/tcp
firewall-cmd --permanent --add-port=445/tcp
firewall-cmd --permanent --add-port=901/tcp
I turned off Windows Firewall just to see if it would make a difference and it does not.

I have tried mapping the share as a network drive and it behaves the same as described previously.

I blew the permissions of the directory and files inside wide open (777) just for testing, but still nothing.

I'm completely at a loss as to what could be causing this problem. Thank you in advance for your help.
Last edited by tangozuluniner on 2015/08/27 03:47:03, edited 1 time in total.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Samba: Empty directories on Windows!

Post by lightman47 » 2015/08/26 13:13:47

No answers but some thoughts:
Is nmb running?
Is cody's password the same on both machines?
Have you tried with Selinux temporarily disabled (sudo setenforce 0)?
- drawing a blank now

tangozuluniner
Posts: 4
Joined: 2015/08/18 20:09:29

Re: Samba: Empty directories on Windows!

Post by tangozuluniner » 2015/08/26 22:26:09

I want to hug you.

'sudo setenforce 0' did the trick.

Wow. Thank you! Thank you! Thank you!

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Samba: Empty directories on Windows!

Post by gerald_clark » 2015/08/26 22:32:37

What is mounted on /mnt/hello? What is the filesystem type?
Show the output of:
ls -l /mnt
ls -l /mnt/hello

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: [SOLVED] Samba: Empty directories on Windows!

Post by lightman47 » 2015/08/27 12:41:05

setenforce is a temporary disable - at next boot Selinux will be running again. The fact that it worked for you tells you that you have an access issue that needs attention - so Selinux will allow that access.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: [SOLVED] Samba: Empty directories on Windows!

Post by TrevorH » 2015/08/29 22:20:57

There are instructions at the top of the default /etc/samba/smb.conf on how to deal with selinux issues and the correct labels to assign to the directories and files you wish to share.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hooge
Posts: 1
Joined: 2019/02/03 17:41:01

Re: [SOLVED] Samba: Empty directories on Windows!

Post by hooge » 2019/02/03 17:47:15

Confirmed disabled SELINUX works for this issue on CENTOS 7 (3.10.0-957.5.1.el1.centos.plus.i686) and Windows 10. :|

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: [SOLVED] Samba: Empty directories on Windows!

Post by TrevorH » 2019/02/03 18:09:38

Disabling selinux is not recommended. As said previously, there are detailed instructions on how to configure samba/selinux to work with each other at teh top of the default /etc/samba/smb.conf that we ship.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply