CodexBloom - Programming Q&A Platform

Samba Permissions guide on CentOS 8 - how to to Write to Shared Directory

πŸ‘€ Views: 0 πŸ’¬ Answers: 1 πŸ“… Created: 2025-08-22
samba centos permissions linux bash

I need help solving I'm updating my dependencies and I'm attempting to set up I'm relatively new to this, so bear with me... I'm running a Samba server on CentOS 8, and I'm working with a frustrating scenario where users need to write to a shared directory, even though the permissions seem to be set correctly. I have configured the Samba share in my `smb.conf` like this: ```ini [shared] path = /srv/samba/shared browseable = yes read only = no writable = yes valid users = @sambashare ``` The directory permissions are set as follows: ```bash # ls -ld /srv/samba/shared drwxrwxr-x. 2 root sambashare 4096 Oct 10 12:00 /srv/samba/shared # getfacl /srv/samba/shared # file: /srv/samba/shared # owner: root # group: sambashare user::rwx group::rwx other::r-x ``` I’ve added users to the `sambashare` group and updated the Samba password using `smbpasswd`. However, when users try to create files within the shared directory, they get a permission denied behavior: ``` behavior opening file: Permission denied ``` I've double-checked the SELinux status with `sestatus`, and it’s currently enforced. I suspect this might be related to SELinux policies, so I checked the current context: ```bash # ls -Z /srv/samba/shared drwxrwxr-x. root sambashare unconfined_u:object_r:samba_share_t:s0 /srv/samba/shared ``` It seems like the context is correct for Samba, but I'm not sure if there's something else I need to configure. I also tried running `setsebool -P samba_enable_home_dirs on` but that didn't help. Any insights on what might be blocking write access would be greatly appreciated. I'm using Bash latest in this project. Has anyone dealt with something similar? Thanks for your help in advance! My development environment is Ubuntu 20.04. Cheers for any assistance! For reference, this is a production web app. Thanks, I really appreciate it!