#安装软件
pacman -S samba
#下载配置文件
wget "https://git.samba.org/samba.git/?p=samba.git;a=blob_plain;f=examples/smb.conf.default;hb=HEAD" -O /etc/samba/smb.conf
#在smb.conf中添加共享配置
[test]
path = /opt/services/samba/test
max shares = 100
allow guests = yes
owner only = yes
browseable = yes
writable = yes
valid users = user1
public = yes
guest ok = yes
#创建相关文件夹及设置权限
groupadd sambashare
mkdir /opt/services/samba/test -p
chown -R root:sambashare /opt/services/samba
chmod 1770 /opt/services/samba/test
usermod -G sambashare user1
smbpasswd -a user1
#打开端口
systemctl stop iptables
#启动
systemctl restart smb.service
systemctl restart