首先安装samba
pkg install samba413
然后添加samba用户root备用
pdbedit -a -u root
然后创建文件/usr/local/etc/smb4.conf
[global]
workgroup = 0x5.io
realm = test.0x5.io
netbios name = test
interfaces = 0.0.0.0
bind interfaces only = yes
use sendfile = true
aio read size = 65536
aio write size = 65536
[diska]
path = /disk/a
public = no
writable = yes
printable = no
guest ok = no
valid users = root
[diskb]
path = /disk/b
public = no
writable = yes
printable = no
guest ok = no
valid users = root
[diskc]
path = /disk/c
public = no
writable = yes
printable = no
guest ok = no
valid users = root
然后运行下面几个命令方便来启动
mv /usr/local/etc/rc.d/samba_server /usr/local/etc/rc.d/samba
echo 'samba_server_enable="YES"' >> /etc/rc.conf
service samba restart