samba icon indicating copy to clipboard operation
samba copied to clipboard

Trouble accessing private share on windows 10

Open charesch opened this issue 4 years ago • 3 comments

It works flawlessly with a public share, but the private share is not accessible.

I'm using cockpit to run the container using this config :

Volumes /mnt/media to host path /mnt/public to host path

Environment NMBD -> yes PERMISSIONS -> yes USER -> charesch;12345;1000;charesch;1000 SHARE1 -> Media;/mnt/media;yes;no;no;charesch SHARE2 -> Public;/mnt/public;yes;no;yes USERID -> 987 GROUPID -> 984

I've tried giving 777 permissions to the media folder on the host, but I still get the same error : Share name is not accessible.

Any help would be appreciated.

charesch avatar Nov 02 '20 06:11 charesch

The solution is to do the following on windows 10 clients : Set-SmbServerConfiguration –EnableSMB2Protocol $false

https://docs.microsoft.com/en-us/windows-server/storage/file-server/troubleshoot/detect-enable-and-disable-smbv1-v2-v3

charesch avatar Nov 09 '20 18:11 charesch

Set-SmbServerConfiguration –EnableSMB2Protocol $false

this is not the answer, becuase this controls the Windows 10 SMB server. This issue is about a Windows 10 SMB client accessing a share.

leojonathanoh avatar Sep 14 '21 17:09 leojonathanoh

i got it working:

try this:

version: '2.2'
services:

  samba:
    image: dperson/samba
    ports:
      - 139:139/tcp
      - 445:445/tcp
    environment:
      - USER1=foo;foo;1000;foo;1000
      - SHARE1=share;/share;yes;no;no;foo;none;;comment1
    volumes:
      - ./:/share
    restart: unless-stopped
    command:
      # Workaround: Do not force all connecting users to function under 'smbuser' permissions. See: https://github.com/dperson/samba/issues/334#issuecomment-706720780
      - -g
      - force user =
      - -g
      - force group =
      # Workaround: Enable Windows 10 to prompt for password. See: https://github.com/dperson/samba/issues/359
      - -g
      - restrict anonymous = 2
      - -g
      - map to guest = never

works nicely with prompts for credentials. The important bit is -g restrict anonymous = 2 and -g map to guest = never. Props to #359

leojonathanoh avatar Sep 14 '21 21:09 leojonathanoh