1

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.

3 Answers 3

0

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.

0

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.

0

Instead of disabling selinux set the proper boolean and security context values as follows. (I assume "sharing" is samba share name)

setsebool -P samba_export_all_ro=1 samba_export_all_rw=1 getsebool -a | grep samba_export semanage fcontext -at samba_share_t "/sharing(/.*)?" restorecon /sharing 

Also you may need to add some rules to allow traffic for samba.

firewall-cmd --permanent --add-service=samba firewall-cmd --reload 
1
  • firewall is disabled so there is no need to add any rule for that also. Commented Feb 17, 2021 at 5:18

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.