Can't access SMB shares on Windows but can on Linux

0

I've been having some problems with a Samba share that I recently set up.

The share's configuration is as follows:

[data]
path = /media/data
available = yes
valid users = admin
read only = no
browseable = yes
public = yes
writable = yes

I have been able to access the share on both Linux and OS X through smbclient, but on Windows I get a "cannot access" error (0x80070002, system cannot find the file specified). The syntax I'm using on Windows is \\<server-ip>\data, but \\<server-ip>\media\data doesn't work either.

Update: I managed to compile Samba on Windows via Cygwin and got smbclient working under it, but I still cannot connect to the share through the native client on Windows.

Update 2: Partial breakthrough! The problem was with a registry key, ProviderOrder, used by Windows to determine which SMB client to use. Mine had been slightly changed by a previous experiment with NFS. To fix it, I set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order\ProviderOrder to the following: vmhgfs,hgfs,LanmanWorkstation,RDPNP. That got me as far as the login prompt, after which I got another error, 0x800704cf.

Update 3: Success! The component at fault here was my adapter's 'Client for Microsoft Networks' package. Once installed, all I had to do was reset the adapter and my share connected seamlessly.

linux
windows
samba
server-message-block
cifs
asked on Server Fault Aug 14, 2014 by woodruffw • edited Aug 15, 2014 by woodruffw

3 Answers

2

I managed to solve my problem.

There were two components at fault: the ProviderOrder registry key, and a missing adapter package.

Fault One:

SMB on Windows looks at the ProviderOrder registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order\ to determine which implementation of SMB/CIFS to use. If there is no implementation or an incorrect one listed, Windows gives up. To fix it, simply append this string to the one already in ProviderOrder: mhgfs,hgfs,LanmanWorkstation,RDPNP.

Fault Two:

In my case, it seems that my adapter simply came with the 'Client for Microsoft Networks' disabled for some reason or another. To enable it on any adapter, go to the Network and Sharing Center, click 'Change Adapter Settings,' and right click to 'Properties' on your active adapter. From there, select 'Install...', and select 'Add...' on 'Client.' Simply select the 'Client for Microsoft Networks' from the window that appears and click OK. Then, reset your adapter or reboot.

answered on Server Fault Aug 15, 2014 by woodruffw • edited Jun 11, 2020 by Community
0

The correct path is \\data. The admin user is added in the Linux and Samba? In the Samba, use the binary smbpasswd to add the user.

answered on Server Fault Aug 14, 2014 by jonatasbaldin
0

I have read that you need to include these directives to your conf for windows to work.

hosts allow = 127.0. x.x.x.x etc
hosts deny = 0.0.0.0/0

I am having a similar issue, but haven't resolved it yet.

answered on Server Fault Aug 14, 2014 by Satalink

User contributions licensed under CC BY-SA 3.0