this post was submitted on 25 Mar 2025
-1 points (0.0% liked)

Selfhosted

49527 readers
655 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

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

top 4 comments
sorted by: hot top controversial new old
[–] foggy@lemmy.world 0 points 3 months ago (1 children)

You're running into that permission error because of how Docker handles file permissions between the host and the container. It's by design for security reasons. The user inside the container likely doesn't have access to the mounted directory unless the UID and GID match what's on the host. You can work around it, but it's locked down intentionally.

Also, what's the use case here? What do you need file sharing via Samba in a Docker container for? If it's just about moving files in and out, docker cp or docker exec -it container /bin/bash might be easier.

[–] sugar_in_your_tea@sh.itjust.works -1 points 3 months ago

Idk about OP, but I want to run all of my exposed services in containers for security benefits, and I use samba to provide an SMB share for Windows clients.

[–] carloshr@lile.cl 0 points 3 months ago* (last edited 3 months ago) (1 children)

The easy way, but not the most secure: identify GID and UID of files created by your samba docker container with "ls -la". Then assign ownership of files and directories of shared volume to that user/group "chown -R GID:UID /path/to/shared”

@basic_user @selfhosted

[–] basic_user@lemmy.world -1 points 3 months ago

Do I just enter the container shell and check GID and UID of a random file?