Install samba4.1.1 on CentOS7
Install samba in centos 7. Only upload is allowed, but deletion is not allowed. As follows:
1. Install samba:
[Root @ samba ~] # Yum install-y samba-common samba-libs
2. Back up the main samba configuration file smb. conf:
[Root @ samba ~] # Cp/etc/samba/smb. conf {,. bak}
3. Clear the master configuration file:
[Root @ samba ~] #>/Etc/samba/smb. conf
4. The configuration is as follows:
[Global]
Workgroup = WORKGROUP
Server string = Samba Server Version % v
Security = share
Log file =/var/log/sambalog. % m
Load printers = yes
Security = user
Map to guest = Bad User
Cups options = raw
[Share]
Comment = share all
Path =/data/samba
Browseable = yes
Public = yes
Read only = no
# Valid users = nobody
Create mask = 1444
Directory mask = 1755
5. Create a shared directory:
[Root @ samba ~] # Mkdir-p/data/samba
6. Set the group and master:
[Root @ samba ~] # Chown-R nobody. nobody/data/samba
7. Start samba:
[Root @ samba ~] # Systemctl start smb
8. Enable ports 139 and 445 of the firewall:
[Root @ samba ~] # Iptables-I INPUT-p tcp-m multiport 139,445-j ACCEPT
9. Test Access and create a directory and a file in the shared directory. (Note: This directory can be deleted if no file exists in the new empty directory; when there are any files in the directory, the directory cannot be deleted unless the Administrator is notified to delete the files at the backend of the server !)