From 2ad7697142eea10ea141ff5a7ec17661f9b8e951 Mon Sep 17 00:00:00 2001 From: padriano Date: Sat, 9 May 2026 22:34:52 +0100 Subject: [PATCH] fix samba write permissions and document UID requirement The dperson/samba image uses UID/GID 1001 internally regardless of the USERID env var. The host share directory must be owned by 1001:1001 for writes to succeed. Add force user/group to smb.conf as an extra safety net, and document the chown step in the README. Co-authored-by: Cursor --- README.md | 8 +++++++- samba/smb.conf | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a334d4a..53f2d78 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,12 @@ mkdir -p /home/padriano/share ``` + The Samba container runs as UID/GID 1001 internally, so the share directory must be owned by that user: + + ```bash + sudo chown 1001:1001 /home/padriano/share + ``` + 3. Bring the full stack up: ```bash @@ -127,7 +133,7 @@ docker inspect forgejo ### samba -- Shared directory on the host: `/home/padriano/share` +- Shared directory on the host: `/home/padriano/share` — must be owned by `1001:1001` (the UID/GID the container uses internally); without this, the share mounts on the Mac but files cannot be written - Uses a macvlan network with static IP `192.168.1.247` — avoids port 445 conflict with the `timemachine` container - Config stored at `samba/smb.conf`; the `[Share]` section is the only exported share - Avahi service file at `samba/avahi-smb.service` advertises the share for Finder sidebar discovery (installed to `/etc/avahi/services/samba.service` on the host) diff --git a/samba/smb.conf b/samba/smb.conf index 1e97880..6f34831 100644 --- a/samba/smb.conf +++ b/samba/smb.conf @@ -45,3 +45,5 @@ directory mask = 0775 inherit permissions = no valid users = samba + force user = samba + force group = samba