1、打开 sudo vi /etc/samba/smb.conf文件,在最底部添加下面内容,根据自己账号和目录进行修改
[lis]
comment = Shared Folder with username and password
path = /home/lis
public = yes
writable = yes
valid users = lis
write list = lis
read list = lis
create mask = 0777
directory mask = 0777
create mode = 0777
directory mode = 0777
#force user = @TYFan
#force group = @TYFan
available = yes
browseable = yes
#guest ok = yes
#read only = no
2、sudo smbpasswd -a lis //设置密码
3、sudo smbpasswd -e lis //使能用户
4、sudo systemctl restart smbd
5、在windows下添加一个网络位置,输入ip\文件夹,输入账号密码