LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Unable to MAP Samba share to Windows (https://www.linuxquestions.org/questions/linux-server-73/unable-to-map-samba-share-to-windows-4175716787/)

mfoley 09-15-2022 01:00 PM

Unable to MAP Samba share to Windows
 
I have two samba shares on host "quadmon":
Code:

[trashbin]
  comment = Main Work Directory
  path = /mnt/novatec/trash
  read only = no
  public = yes
  set mask = 0660

[mfoley]
  comment = mfoley
  path = /mnt/novatec/mfoley
  read only = no 
  public = yes 
  set mask = 0660

From Windows 10 I could map [trashbin], no problem. With [mfoley] I get the error:
Quote:

The network folder specified is currently mapped using a different user name and password. To connect using a different user name and password, first disconnect any existing mapping to this network share.
If I disconnect [trashbin] and try again, I get, "The specified network password is not correct."

I have deleted all credentials in the Windows Credential Manager. I have added the user credentials to smbpasswd, twice in fact; in case I messed it up the 1st time.

I've checked to make sure the mapping user has permission to the shared directory.

Now that I've done all that credential removal and smbpasswd updating, I can no longer even map [trashbin].

I'm out of ideas. What am I doing wrong?

michaelk 09-15-2022 02:23 PM

If [homes] is enabled that would automatically create a share called mfoley if you have a username mfoley on that PC.

mfoley 09-15-2022 04:23 PM

Quote:

Originally Posted by michaelk (Post 6380451)
If [homes] is enabled that would automatically create a share called mfoley if you have a username mfoley on that PC.

Yes, I've done that in the past, but in this case it is not a user on the local computer. It's just a mapped folder by that name.

michaelk 09-15-2022 05:26 PM

I assume you are using the same user name to connect to mfoley as trashbin?

mfoley 09-20-2022 11:10 AM

Quote:

Originally Posted by michaelk (Post 6380492)
I assume you are using the same user name to connect to mfoley as trashbin?

Yes

I don't know if this helps or adds to the confusion. If, logged into the samba sharing host as user mfoley and I do 'smbclient -L localhost -U mfoley' it fails when I enter my pw. If I do 'smbclient -L localhost', no -U, that works after entering the exact same password:
Code:

$ smbclient -L localhost -U mfoley
Password for [WORKGROUP\mfoley]:
session setup failed: NT_STATUS_LOGON_FAILURE

$ smbclient -L localhost
Password for [WORKGROUP\mfoley]:
Anonymous login successful

        Sharename      Type      Comment
        ---------      ----      -------
        homes          Disk      Home Directory on quadmon
        backup          Disk      Backup Directory
        trashbin        Disk      Main Work Directory
        novatec        Disk      Novatec
        mfoley          Disk      mfoley
        IPC$            IPC      IPC Service (QUADMON Samba Server)
SMB1 disabled -- no workgroup available


michaelk 09-20-2022 11:21 AM

I assume that you verified no other network drive is mapped to mfoley?

mfoley 09-20-2022 01:09 PM

Quote:

Originally Posted by michaelk (Post 6381375)
I assume that you verified no other network drive is mapped to mfoley?

As far as I know. Both the samba sharing host and the Windows computer have been rebooted several times. The Windows computer shows no drives mapped.

The logfile /var/log/samba.clients has the following:
Code:

[2022/09/20 12:24:44.370030,  0] ../../lib/param/loadparm.c:747(lpcfg_map_parameter)
  Unknown parameter encountered: "set mask"
[2022/09/20 12:24:44.391687,  0] ../../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
  Ignoring unknown parameter "set mask"
[2022/09/20 12:24:44.391888,  0] ../../lib/param/loadparm.c:747(lpcfg_map_parameter)
  Unknown parameter encountered: "set mask"
[2022/09/20 12:24:44.391957,  0] ../../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
  Ignoring unknown parameter "set mask"
[2022/09/20 12:24:44.392164,  0] ../../lib/param/loadparm.c:747(lpcfg_map_parameter)
  Unknown parameter encountered: "set mask"
[2022/09/20 12:24:44.392334,  0] ../../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
  Ignoring unknown parameter "set mask"
[2022/09/20 12:24:44.393041,  0] ../../source3/auth/token_util.c:565(add_local_groups)
  add_local_groups: SID S-1-5-21-1479953959-952874055-1012799137-1001 -> getpwuid(1000) failed, is nsswitch configured?

Does this give any clues? What would go in nsswitch? I've not had to use that before.

michaelk 09-20-2022 02:03 PM

Quote:

$ smbclient -L localhost -U mfoley
Password for [WORKGROUP\mfoley]:
session setup failed: NT_STATUS_LOGON_FAILURE

$ smbclient -L localhost
Password for [WORKGROUP\mfoley]:
Anonymous login successful
I am guessing your smbpasswd could be messed up.

mfoley 09-23-2022 01:46 PM

I've got it working! Finally. I added the following two directives to smb.conf:
Code:

security = user  (this one was already there)
unix password sync = yes

# and on the shares:

  valid users = myuserid

Not sure which of these made it work. Maybe both.


All times are GMT -5. The time now is 09:28 PM.