1、更新apt
sudo apt-get upgrade
sudo apt-get update
sudo apt-get dist-upgrade
2、安装samba
sudo apt-get install samba samba-common
3、创建samba分享的目录
我这里直接分享的就是/home/your username下的所有内容,所以就不用创建了
4、添加samba用户名和密码
# 添加用户,isesame是我的用户名
sudo smbpasswd -a isesame
#然后会要求你输入密码
5、配置samba配置文件
sudo nano /etc/samba/smb.conf
# 在最后添加以下内容
[share]
comment = share folder
browseable = yes
path = /home/isesame/
create mask = 0700
directory mask = 0700
valid users = isesame
#force user = isesame
#force group = isesame
public = yes
available = yes
writable = yes
read only = no
重启samba服务器即可
sudo systemctl restart smbd