Hi, I’ve tried running samba from docker compose on ubuntu server with this resource https://hub.docker.com/r/dockurr/samba I changed the default volume from “- ./samba:/storage” to “- /mnt/my_ext_hdd/my_dir/my_subdir” The container deploys fine, but I get permission error when trying to access the shared volume from windows? Anyone with some suggestionshoew to fix? Thanks

  • basic_user@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    5 days ago

    Well, I’m not trying to share from within the docker container. I just want to run the samba service from a container. The share is an external hard drive connected to the server. I want to be able to move files to and from the ext hdd from a windows machine.

    • foggy@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      4 days ago

      Okay, the permission error is almost certainly because the Samba process inside the container doesn’t have the right Linux permissions for the host directory /mnt/my_ext_hdd/my_dir/my_subdir.

      On your server running docker, find the numeric UID and GID for that directory: ls -ln /mnt/my_ext_hdd/my_dir/my_subdir

      you likely need to set PUID=<uid_from_step_1> and PGID=<gid_from_step_1> in the environment: section of your docker-compose.yml file for the Samba service.

      Recreate the container (docker compose up -d --force-recreate).

      WARNING: This assumes you are only accessing Samba from within your secure local network. Never expose Samba directly to the internet. Doing so is a major security risk and makes you a target for attacks.