环境 Ubuntu 22.04
1.安装samba
sudo apt-get install samba
2.添加新的samba用户
sudo smbpasswd -a username
#set your password
3.修改share文档的权限
sudo chmod 777 [path]
4.修改配置文件
打开配置文件
sudo vim /etc/samba/smb.conf
在配置文件底部添加以下内容
[username]
comment = samba home directory
path = /home/username
public = yes
browseable = yes
public = yes
writeable = yes
read only = no
valid users = username
create mask = 0777
directory mask = 0777
available = yes
5.重启samba服务
sudo systemctl restart smbd.service