Background
After restarting the virtual machine on one day linux , windows after my connection samba , when I click some folders, there will be no permission to open the situation. This is a problem that I have reconfigured several times samba in the configuration, but no results.
Solve
After searching, there are two ways to solve the problem that some folders in Samba can't be accessed.
- Method one modifies the security policy of files and folders;
- Method two closed
selinux ;
The first method is not appropriate, only a temporary solution. Because windows after you create a new linux folder, the next time linux you restart, the new folder is inaccessible. Trouble. The second method is simple, once and for all.
Although the internet said the closure selinux will have security issues. However, just the development of my virtual machine linux , not the production environment, not too high security issues.
Method one modifies the security policy
chcon -t samba_share_t share
Chcon can modify the security context of a file. Resets security information for files and folders established by Windows. can also be solved, but more troublesome, inconvenient.
Method two close SELinux permanently shut down
Modify /etc/selinux/config files, set
SELINUX=disabled
Then restart Linux.
Temporarily closed
Use the setenforce command to modify the selinux pattern.
setenforce 1Set selinux to enforcing mode;
setenforce 0Set selinux to permissive mode.
Other Solutions
Https://wiki.centos.org/zh/HowTos/SetUpSamba has a fairly detailed explanation and solution. There is time to toss to see.
Above.
[Linux]windows does not have access to samba security issues (turn off SELinux)