安装和配置smb

更新源

sudo apt update
#安装
sudo apt install samba -y
#开放某些文件夹权限
chmod 0777 Share
#备份
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
#编辑
sudo vim /etc/samba/smb.conf

设置密码 sudo smbpasswd -a root

重启服务 systemctl restart smbd.service

开启服务 systemctl enable smbd.service

查看状态 systemctl status smbd.service

配置文件示例:

[share]
comment = share for data
path = /mnt
browseable = yes
read only = no
public = yes
writable = yes
available = yes
guest ok = no                   
valid users = root