LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   Samba shares show empty folders (https://www.linuxquestions.org/questions/linux-wireless-networking-41/samba-shares-show-empty-folders-644525/)

Venefyxatu 05-24-2008 02:51 PM

Samba shares show empty folders
 
Hi,

I've seen several threads of people with a similar problem, but none of those have been able to help me out. Allow me to explain:

I have a NAS device in a 192.168.30.x network that offers a few Samba shares. If I connect my laptop, which is running Vista Business, to the same network it can browse through the shares all it likes, write to the writeable folders, etc.

The 192.168.30.x network is firewalled / NAT'ed behind a Gentoo box that separates it from a 192.168.2.x network. Port forwarding has been set up to send incoming Samba connections to the NAS device.

If I connect my laptop to the 192.168.2.x network I can still connect to the NAS device, see the shared folders (which makes me assume that my firewall is set up correctly), but they all appear as being empty.

The Samba configuration is as follows (looks fairly simple, so it should be hard to make mistakes in there ;) ):

/etc/samba/smb.conf :

Code:

[global]
server string=Purgatory
workgroup=Shadowrealm
interfaces=192.168.30.227/27 127.0.0.1/8
security=user
smb passwd file=/var/private/smbpasswd
private dir=/var/private
guest account=www-data
log file=/var/log/log.%m
log level=10
max log size=50
dns proxy=No
lock directory=/var/locks
pid directory=/var/locks
use sendfile=Yes
map to guest = Bad User
create mask = 755
map hidden = Yes
veto files = /shares/internal/.senvidData/ /shares/internal/lost+found/

[dummy-2]
include=/var/oxsemi/shares.inc

[dummy-3]
include=/var/oxsemi/senvid.inc



/var/oxsemi/shares.inc :
Code:

[dump]
path=/shares/internal/dump
force user=www-data
valid users=www-data
write list=www-data
guest ok=Yes
browseable = yes

[MUSIC]
path=/shares/internal/MUSIC
force user=www-data
guest ok=Yes
valid users=www-data
read list=www-data
browseable = yes

[PUBLIC]
path=/shares/internal/PUBLIC
force user=www-data
valid users=www-data
write list=www-data
guest ok=Yes

/var/oxsemi/senvid.inc is an empty file ...


I'm quite stumped here - any advice would be welcome.

jschiwal 05-25-2008 08:16 AM

Is that the smb.conf file for the NAS device or your laptop?

Also check the firewall settings for the Laptop. Which ports are open. Which samba services are running on the Laptop. The nmbd service needs to run for the laptop client. The smbd daemon is for the server. If the laptop doesn't offer a share you don't need it. ( I stopped the nmbd daemon and tested this out to make sure )

Try the command (from the laptop):
smbclient -L <servername>

Do you see a list of the shares?

Check if you can reach ports 139 & 445. You could use nmap: nmap <server IP>
or if you don't have nmap installed, you can see if the ports are open on the server using the telnet client:
telnet <server> 139

telnet <server> 445

You won't be able to do anything but be connected. But that is what you are testing.
Code:

telnet hpamd64.local 445
Trying 192.168.1.107...
telnet: connect to address 192.168.1.107: Connection refused

Code:

telnet hpamd64.local 445
Trying 192.168.1.107...
Connected to hpamd64.local.

The "Samba 3 HOWTO & Reference" book may be supplied by either your samba package or a samba-doc package or you can download it from the net. It has a Section on browsing, which is what your problem seems to be.

Also, what are you using as a browser?

Venefyxatu 05-25-2008 12:08 PM

Thanks for the suggestions!

I booted the laptop to linux (I was trying in Vista yesterday, using Windows Explorer since I intend to offer these shares to other Windows-only clients) to try them out; here are the results :

[colde]
venefyxatu@lap008 ~ $ smbclient -L 192.168.2.30
Password:
Domain=[PURGATORY] OS=[Unix] Server=[Samba 3.0.23c]

Sharename Type Comment
--------- ---- -------
dump Disk
MUSIC Disk
PUBLIC Disk
IPC$ IPC IPC Service (Purgatory)
Domain=[PURGATORY] OS=[Unix] Server=[Samba 3.0.23c]

Server Comment
--------- -------

Workgroup Master
--------- -------
SHADOWREALM PURGATORY
WORKGROUP NECRONOMICON
[/code]

So yes, there is a list of shares. That's a good start :)

Code:

venefyxatu@lap008 ~ $ sudo nmap 192.168.2.30

Starting Nmap 4.53 ( http://insecure.org ) at 2008-05-25 19:00 CEST
Interesting ports on 192.168.2.30:
Not shown: 1711 filtered ports
PORT    STATE  SERVICE
139/tcp  open  netbios-ssn
MAC Address: 00:20:18:3C:41:86 (CIS Technology)

Nmap done: 1 IP address (1 host up) scanned in 6.201 seconds

(left out the irrelevant ports).

That's odd - 139 tcp is the only relevant one that's shown as open, although it gets the exact same treatment as 445 tcp and 137&138 udp in the firewall. I'll look into that, see if I can find anything.

Will check the Samba 3 HOWTO & Reference handbook as well.

Thanks for the pointers!

jschiwal 05-26-2008 02:36 AM

Code:

Starting Nmap 4.20 ( http://insecure.org ) at 2008-05-26 02:20 CDT
Interesting ports on hpmedia.jesnet (192.168.1.105):
Not shown: 1690 closed ports
PORT    STATE SERVICE
21/tcp  open  ftp
22/tcp  open  ssh
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
2049/tcp open  nfs
3306/tcp open  mysql

One of the problems that some people have with browsing a windows network is that there are 3 technologies. The browser you are using in Linux may be using an older (NETBEUI) based technology (ports 137-139). Originally browsing was network broadcast based but this caused to much activity on the network. With NT, MS introduced WINS which tries using the WINS server before falling back to using broadcasts. With XP TCP is used with preference given to DNS. The Samba Reference goes into the gory details.

If you have the PDF version of the Samba 3 HOWTO & Reference Guide, Search for the numbers 137, 138, 139 & 445. I'm not certain but in some cases dealing with printing services, you may need 137 open as well (RPC Endpoint).

Venefyxatu 05-27-2008 01:21 PM

Quote:

Originally Posted by jschiwal (Post 3164669)
Code:

Starting Nmap 4.20 ( http://insecure.org ) at 2008-05-26 02:20 CDT
Interesting ports on hpmedia.jesnet (192.168.1.105):
Not shown: 1690 closed ports
PORT    STATE SERVICE
21/tcp  open  ftp
22/tcp  open  ssh
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
2049/tcp open  nfs
3306/tcp open  mysql


This was indeed the result I'd expected here in my own network. I'm still unsure as to why 137 is not shown. Like I said, it gets the exact same treatment as 139 in the firewall rules. Should I find out the reason why, I'll make sure to post it here.

Aside from that, I just tried accessing the shares with Nautilus from my laptop and, surprise, it works! So far I'd only tried with Windows Explorer on Vista. That one still shows empty folders, so I've decided to Blame Vista :P

I'll see if I can get my hands on something XP-ish. Maybe I can then Blame Microsoft ;)

Addendum : I got my hands on an XP client, and it works there, too. So apparently, "something" changed in Vista...


Thanks for your assistance!

jschiwal 05-27-2008 10:19 PM

Microsoft makes some changes with each version they put out. The good news is that they tend to correct their own past mistakes. Samba relies on studying how Windows works in reality by studying the network traffic rather than reverse engineering Windows code. So if MS goes closer to it's own specs, samba needs to be readjusted to undo some quirks that older clients had. What windows documentation there is may be wrong. One thing to look at is the version of Samba being used by the NAS. It may need to be updated to av version recent enough to work with Vista. Also, since the problem is with Vista, look up on the net what changes were made in Vista on how browsing works. It could be that port 445 is the only one used. Maybe vista only supports DNS or WINS. If there is a field in the network device configuration for a wins server, samba can act as one. This might help. The servers name or IP address will need to be provide to Vista, either in this configuration dialog or by entering it in your DHCP server's (or Router's) setup. I think that WINS uses port 1512/tcp (according to "getent services wins"). The winbind service on the NAS or the Linux clients may need to be enabled then.

My rough guess is that some of the older technologies, which were de-emphasized in XP are now totally dropped.

Microsoft controls the clients so that makes life more difficult for the Samba team.

To give you an idea, MS removed support from their embedded windows version that allowed a device to be used with a standalone domain controller. This is the most common configuration for Samba servers. When Jeremy Allison tried a patch to fix this, an embedded device could work with samba but everything else broke, so he had to pull the patch. The NFS4 programmers relied on the MS documentation on how ACLs worked when they adapted MS acls for NFS V4. The problem is that the MS specs were either wrong or disinformation. This is what upset the Judges so much in the anti-trust case in the EU. That case's main theme is on network interoperability.

You could also study the NAS's samba logs and see it there is traffic it isn't seeing or doesn't understand. Or run wireshare to discover which ports the Vista traffic uses.

Good Luck!

jschiwal 05-27-2008 10:42 PM

Code:

[PUBLIC]
path=/shares/internal/PUBLIC
force user=www-data
valid users=www-data
write list=www-data
guest ok=Yes

Code:

[global]
        workgroup = JESNET
        map to guest = Bad User
        obey pam restrictions = Yes
        pam password change = Yes
        acl compatibility = winnt
        server signing = auto
        printcap name = cups
        logon path = \\%L\profiles\.msprofile
        logon drive = P:
        logon home = \\%L\%U\.9xprofile
        preferred master = No
        domain master = No
        wins server = eth1:192.168.1.105, eth2:192.168.1.105
        ldap ssl = no
        usershare allow guests = Yes
        printing = cups
        cups options = raw
        print command =
        lpq command = %p
        lprm command =
        include = /etc/samba/dhcp.conf

[profiles]
        comment = Network Profiles Service
        path = %H
        read only = No
        create mask = 0600
        directory mask = 0700
        store dos attributes = Yes

...
[opensuse103]
        path = /suse
        guest ok = Yes

[wildswede]
        path = /srv/samba
        read only = No
        guest ok = Yes

Here are parts of the smb.conf for my laptop. I tend to use NFS and have mucked a bit with the samba config when demonstrating samba configs on LQ in answering posts. The wildswede is one such share where I demonstrated a pubic share. Sometimes simpler is better.

I really don't like "security = SHARE" which the Samba documentation states is obsolete (win95). Also, I don't like force user and force group for a public share.
The "map to guest = Bad User" in the [General] section and "Guest OK = Yes" in the share definition allows unauthorized users to use the public share, but still lets authorized users to retain the permissions and acls. A Linux user can even mount a Samba share using the cifs filesystem and use "setfacl".

The WINS server refers to my Desktop's IP. That line is actually modified by when I boot up and is provided by the DHCP server of my router. My eth0 NIC failed as I was listening to a podcast, and I quickly learned how to setup and configure wireless with the bcm43xx driver in record time! Necessity is the mother of invention as they say. ( I had used ndiswrapper before SuSE 10.2 ). Later I dug up a pcmcia nic device.

cdb2cdb 06-18-2008 12:20 AM

In Vista make a link to a samba share like
net use z: //samba/_share \user:username
or rightclick in explorer and choose make a link

Mind you: never ever install ms-update kb942624
it screws up everything

Obig 06-18-2008 01:50 AM

We tested vista in our company to work with a samba server with wins active.
The shares created by the logon script appear to be empty but if you do a map network drive it worked.
Also just some network shares were empty and others not. The empty ones Vista didn't see as a networkshare but if I my memory is well it saw it as a optical device or something like that :-D
Still some problems with vista it seems to me.
They put it on new sold pc's while it is still bugged as hell typically MS.
I've heard something about the new version of samba would support Windows 2008 so I hope also vista.


All times are GMT -5. The time now is 11:12 AM.