确认smba安装,没有的话先安装
yum install -y smba
创建访问用的用户,例如share
useradd share
设置smb用户和密码
smbpasswd -a share
配置文件/etc/smba/smb.conf
# windows的workgroup
workgroup = WORKGROUP
[share01]
comment = share directory
browseable = yes
writable = yes
path = /data/share_folder
public = no
权限问题解决
# 配置防火墙开放137-139,445端口
iptables -I INPUT 1 -p tcp --dport 137:139 -j ACCEPT
iptables -I INPUT 1 -p tcp --dport 445 -j ACCEPT
# 设置目录权限
chmod 777 /data/share_folder
# 关闭setlinux
setenforce 0
启动
service smb restart
访问,在windows命令行中访问
\xx.xx.xx.xx
用户名share,密码xxx