I have a Linux server (Linux1) where I have already configured folders to be shared out. It runs on RHEL 7.2. The configuration of my /etc/samba/smb.conf
is as follows:
[sharing]
path = /home/share
guest ok = yes
browseable = yes
read only = no
Everything was working fine, I can access all the subfolders and files in the shared folder from my other Linux server (Linux2). The shared folder was previously mounted as cifs
as /mnt/share
.
I then restarted Linux1, disabled my firewall, and restarted the smb service.
From Linux2, I can see my shared folder and the subfolders, but when I tried to ls
into a subfolder, it says ls: reading directory /mnt/share/subfolder: Permission denied
.
I don't understand why this isn't working now.
I just realized that my SELinux was set to
Enforcing
on Linux1, and that was causing the permissions issue. After disabling it, I was able to access the subfolders and files again.You should not disable SELinux. A better idea would be to change the SELinux settings to allow access to your shares.
Running something like
chcon -t samba_share_t /home/share
should do the trick.Instead of disabling selinux set the proper boolean and security context values as follows. (I assume "sharing" is samba share name)
Also you may need to add some rules to allow traffic for samba.