Accessing public and private shares from Windows


  1. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
       #1

    Accessing public and private shares from Windows


    Last I knew the Windows implementation of SMB allows only one set of network credentials for a given pair of Windows user name and a remote NAS. That means a user cannot access both a public and a private share on the same NAS. I know this has been discussed before but I don't remember seeing any good circumventions.

    The following is what (I think) I know about this topic. I would love to here if any of it is incomplete or incorrect.

    If the NAS has a static IP address multiple names can be assigned to the IP addr on each computer using the etc\hosts file. And I vaguely remember that you can have one set of credentials using the IP address and another using the DNS name. But I would prefer to use dynamic addressing. I've been bitten in the past by having obsolete records in my etc\hosts file, and I recently heard that Windows sometimes deletes etc\hosts. (I haven't seen that happen. It would have saved me some grief if Windows had deleted mine a while ago.)

    If I had access to my local DNS server I could add an Alias or CName record but my DNS server is buried inside of a router/wireless access point box and (as far as I can see) provides no aliasing capability.

    If the IP Resolver component of Windows allowed tweaking I might be able to provide my 3 computers with the equivalent of a CName record but I think the etc\hosts file is the only tweakable part of the Resolver.

    If a caching/forwarding DNS server were available for Windows I could probably give it DNS Alias records but I don't think there is a Windows DNS server except for on servers. And that would really be an overkill solution ... which I might be willing to try.

    I guess I could get a separate router/DNS server that would let me add CName records but tryinging to figure out the configuration hurts my head. I'm not sure it would work at all (unless maybe if the NAS had its own LAN segment connected by that new router).

    Am I missing an easy solution here? How do other people cope with this?
      My Computer


  2. Posts : 17,661
    Windows 10 Pro
       #2

    pokeefe0001 said:
    Last I knew the Windows implementation of SMB allows only one set of network credentials for a given pair of Windows user name and a remote NAS. That means a user cannot access both a public and a private share on the same NAS. I know this has been discussed before but I don't remember seeing any good circumventions.
    I might have misunderstood your point, but at least I have no issues accessing both private and public folders / shares on my NAS. Of the NAS shares I always map (see screenshot), I access share Kari with one set of credentials, Public requires no credentials because, as the name says, it's meant to be public. Share OD, my local backup for everything I store in OneDrive is again accessed with same credentials than Kari:

    Accessing public and private shares from Windows-image.png

    When mapping a network share, you can use different credentials for each share simply by selecting this option:

    Accessing public and private shares from Windows-image.png

    The above option is not required to access public shares on NAS.

    Kari
      My Computer


  3. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
    Thread Starter
       #3

    Hmm. I'm going to have to look deeper into this. I have always had trouble with that and have read (apparently incorrectly) that a public share does take a place in wherever Windows saves credentials - effectively saying that credentials aren't needed. I have the public share permanently mapped; when I try to access the private share in File Explorer I get "Windows cannot access ..." (with the private share name provided). If I just provide the name of the NAS File Explorer brings up the public share.

    Issuing Get-Smbconnection in an elevated PowerShell I get a response showing the credentials:
    PS C:\WINDOWS\system32> Get-SmbConnection
    Code:
    PS C:\WINDOWS\system32> Get-SmbConnection
    
    ServerName ShareName UserName             Credential           Dialect NumOpens
    ---------- --------- --------             ----------           ------- --------
    MyBookLive Public    PUGET-116877\Patrick PUGET-116877\Patrick 2.0.2   1
    And when I try mapping the private share without first going through FileExplorer Windows I get a popup saying the share is already mapped using different credentials. (It is not.)

    Update:
    I did some more searching and found a description of what I'm seeing:
    https://support.microsoft.com/en-us/...o-a-network-sh

    That's a fairly old article - doesn't mention Windows 10 - but it was updated on June 18, 2017.

    Obviously you are not running into this, but just as obviously, I am.
      My Computer


  4. Posts : 17,661
    Windows 10 Pro
       #4

    I had to test this. I found out that I was partially wrong, I apologize it.

    There are no issues in mapping both my personal shares and public (no credentials) shares at the same time. That part was correct in my previous reply. However, adding a share with different credentials, that's where I was wrong. It simply does not work.

    I added a user / share Test on my NAS, with different credentials. Trying to map this share gave the error message you told about:

    Accessing public and private shares from Windows-image.png

    I need to study this more.

    Kari
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 22:24.
Find Us




Windows 10 Forums