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

11,093

Solution 1

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.

Solution 2

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.

Share:
11,093

Related videos on Youtube

woodruffw
Author by

woodruffw

Updated on September 18, 2022

Comments

  • woodruffw
    woodruffw almost 2 years

    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.

    • Satalink
      Satalink almost 10 years
      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/…
    • woodruffw
      woodruffw almost 10 years
      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
      woodruffw almost 10 years
      @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
    woodruffw almost 10 years
    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.
  • Admin
    Admin almost 10 years
    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)
  • woodruffw
    woodruffw almost 10 years
    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.
  • Admin
    Admin almost 10 years
    It's revoking the authentication. Try an 777 permission mode, may be that (shooting everywheeverywhere haha)
  • woodruffw
    woodruffw almost 10 years
    Just tried that. No change. On the other hand, running smbstatus as root got rid of the error. This is really confounding me...
  • Admin
    Admin almost 10 years
    The pdbedit -L shows the admin user? What's the return from the testparm command?
  • Admin
    Admin almost 10 years
    You are not running a distro, right? Never did that, just distros... Is that a vm? Can you export as an OVF upload somewhere?
  • woodruffw
    woodruffw almost 10 years
    I'm running freshly installed Arch. I followed their install guide for Samba. Like I said, the share works perfectly fine on Linux and OS X clients. It's only on Windows that it doesn't connect.
  • woodruffw
    woodruffw almost 10 years
    Tried this, no change. Thanks for the suggestion, though.
  • Admin
    Admin almost 10 years
    There's some configurarion in Conncetions and Shares in the Windows, try to change something there (don't have a Windows box here to tell you certanly). Also, try to turn off the Win FW..
  • woodruffw
    woodruffw almost 10 years
    Nothing in the network configuration seemed pertinent aside from NetBIOS over TCP/IP, which I disabled. My firewall is disabled.
  • Admin
    Admin almost 10 years
    I'm gonna make a test here and report to you!
  • Satalink
    Satalink almost 10 years
    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.
  • pbies
    pbies over 2 years
    Running smbpasswd -a user is crucial here!