docker-samba icon indicating copy to clipboard operation
docker-samba copied to clipboard

Issue with samba permissions

Open killmasta93 opened this issue 3 years ago • 2 comments

Hi Currently need to configure a docker samba for a printer which only has smbv1 to scan i was reading the read me but cant seem to get it working as the printer needs one user called scanner with full access and other user to only read that folder

so this is what i have so far but currently seem to be a permission issue this is my docker config

version: "3.5"
 
services:
  samba:
    image: crazymax/samba
    container_name: samba
    network_mode: host
    volumes:
      - "./data:/data"
      - "./scan:/scan"
    environment:
      - "TZ=Europe/Paris"
      - "SAMBA_LOG_LEVEL=0"
    restart: always 

and the config for the permissions

auth:
  - user: scanner
    group: scanner
    uid: 1000
    gid: 1000
    password: mypass
  - user: client
    group: client
    uid: 1100
    gid: 1200
    password: mypass

global:
  - "force user = scanner"
  - "force group = scanner"

share:
  - name: scannfiles
    path: /scan
    browsable: yes
    readonly: no
    guestok: no
    validusers: scanner,client
    writelist: scanner
    veto: no

but when the user scanner tries to login and create a folder it says denied not sure why

Thank you

killmasta93 avatar May 19 '22 04:05 killmasta93

please try to modify the uid and gid to match with your docker host system related dir permission, e.g. have a check with your mapping dir permission: ls -al ./scan, and understand which local user/group have permission to access this dir, then run id -u <username> to get the uid and gid, then update the uid and gid in the config.yml

fsdrw08 avatar Nov 08 '22 03:11 fsdrw08

Hello @fsdrw08 I did that and did not help

on the host:

drwxr-xr-x  3 mario mario  5 Feb 15 18:59 timemachine
mario@server:/home/mario/config/samba2 $ id -u mario
1000

on the container:

server:/# ls -al timemachine/
total 54
drwxr-xr-x 3 1000 1000    5 Feb 15 18:59  .

on the config:

auth:
  - user: mario
    group: mario
    uid: 1000
    gid: 1000
    password: mario
global:
  - "force user = mario"
  - "force group = mario"

share:
  - name: Timemachine
    path: /timemachine
    browsable: yes
    readonly: no
    guestok: no
    validusers: mario
    writelist: mario
    veto: no
    hidefiles: /_*/
    recycle: yes

and I cannot access the share.

mariomare22 avatar May 29 '23 07:05 mariomare22