The Samba service has been configured on CentOS for several days, and is always a problem that cannot be accessed in Windows Explorer:
I always thought it was me. Smbpasswd-a root command does not add the user, after the addition/deletion repeatedly do not know how many times, or does not work, the Linux and Windows Firewall is shut down, or does not work, then fully started Samba service configuration, Step-by-step operation down,results when you use the following command, you find the reason for no permissions:
a visit to the shared directory on the nt_status_access_denied listing, find the cause is always difficult, the reason to know after the good solution, the original is SELinux blocked.
Workaround One:Close Seliunx[[email protected]/]# getenforce; View current statusEnforcing[email protected]/]# Setenforce 0;SELinux Several states indicate:Enforcing: Mandatory mode, on behalf of the SELinux operation, and has correctly begun to limit the domain/type;Permissive: Tolerant mode: On behalf of SELinux operation, but only a warning message will not actually limit the access of domain/type. This model can be shipped as the use of SELinux debug;disabled: Off, SELinux is not actually running. =========> Direct use of this method can be simple and easy to understand;Workaround Two:change the policy for SELinuxchcon-t samba_share_t shared directory (/var/www/html)
and then it was finally settled;
a summary of the following:1. The Samba service is first installed in the environment and can be installed using the Yum command on CentOS to solve the packet dependency problem;
Yum Install Samba samba-client Samba-swat
2. Configure the service:
If you only access the directory under your own user name, you do not have to configure the smb.conf file;
Add Samba users directly using Smbpasswd-a Chen;
Service operations are performed using commands such as service SMB restart/stop/status/reload;
Samba service does not have permission to access