1. Introduction
Configure the samba sharing server. Only the IP address 10.0.1.1 is allowed to access the sharing Function of the Samba server. At the same time, the files uploaded in the shared folder cannot be modified or deleted. You need to use the file extension attribute of Linux.
2. Disable the Firewall
Vim/etc/SELinux/config
"SELinux = disabled" or "setenforce 0"
3. Configure iptables policies
Iptables-A input-p tcp-s 10.0.1.1 -- dport 138-J accept
Iptables-A input-p tcp-s 10.0.1.1 -- dport 139-J accept
Iptables-A input-p tcp-s 10.0.1.1 -- dport 145-J accept
Service iptables save
Service iptables restart
Iptables-l-N -- line-Number
4. install and configure samba
# Yum install samba-client samba-common
# Groupadd jiaoyi
# Useradd-G jiaoyi user
# Smbpasswd-a user
# Mkdir/customer_file
# Chmod 777/customer_file
# Chmod + T/customer_file # Set the sticky bit
# Mv/etc/samba/smb. conf/etc/samba/smb. conf. Bak
# Vim/etc/samba/smb. conf
[Global]
NetBIOS name = samba
Workgroup = workgroup
Server String = customer file server
Log File =/var/log/samba/log. % m
Max log size = 50
Security = user
SMB passwd file =/etc/samba/smbpasswd
Displays charset = UTF-8
UNIX charset = UTF-8
DOS charset = UTF-8
Deadtime = 100
Max connections = 100
[Customer_file]
Comment = customer file folder
Path =/customer_file
Public = No
Browseable = Yes
Writable = Yes
Create mask = 1400
Directory mask = 1400
Valid users = @ root, @ jiaoyi
# Service SMB start