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.

  • I have this same issue w/ a question open currently. You may want to look through the comments to see if you find help. Mainly, did you add rules to iptables to allow a connection on port 455 and optionally 137,138,and 139? Link to my question: serverfault.com/questions/620502/… – Satalink Aug 14 '14 at 22:53
  • I don't think I'm having problems with iptables, as I can get external clients to connect. Running nmap shows that I have open services on ports 139 and 445, as expected for SMB. Thank you very much for the suggestion, though. I'll forward any solutions that come my way. – woodruffw Aug 14 '14 at 23:15
  • @Satalink you might want to check Update 2 above. I'm not sure if it's related to your problem, but it's gotten me one step closer to fixing mine. Best of luck. – woodruffw Aug 15 '14 at 5:26
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.

  • I added mhgfs, hgfs to ProviderOrder. "Client for Microsoft Networks" was already added to my adaptor settings. Mine is still not working. Glad to hear yours is working though. – Satalink Aug 15 '14 at 14:18
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.

  • Yes, the admin user is added correctly in both, with the password set. I tried disabling NetBIOS (on the theory that it was interfering), but nothing changed. – woodruffw Aug 14 '14 at 22:41
  • How's the selinux configured? I'm not an expert, so I usually disable in file servers. The command is setenforce 0 and the permanent conf is in /etc/sysconfig/selinux (I guess, can't confirm right now) – jonatas.baldin Aug 14 '14 at 22:45
  • It isn't. I'm running a plain Linux kernel, with no SELinux. I just noticed this, however: smbstatus gives me the error NT_STATUS_ACCESS_DENIED. Don't know what that means, though. – woodruffw Aug 14 '14 at 22:50
  • It's revoking the authentication. Try an 777 permission mode, may be that (shooting everywheeverywhere haha) – jonatas.baldin Aug 14 '14 at 22:52
  • Just tried that. No change. On the other hand, running smbstatus as root got rid of the error. This is really confounding me... – woodruffw Aug 14 '14 at 22:55
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.

  • Tried this, no change. Thanks for the suggestion, though. – woodruffw Aug 14 '14 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.