1、安装samba
sudo apt install samba
image.png
2、添加smb用户
注意:用户必须已经存在系统,可以直接添加root或者其他用户,输入smb访问时准备输入的密码
sudo smbpasswd -a demo
image.png
3、添加共享目录
sudo vim /etc/samba/smb.conf
文件末尾增加以下内容
[share]
path = /home/demo/nfs/smb
writable = yes
browseable = yes
public = yes
# guest ok = yes
valid users = demo
force user = demo
force group = demo
create mask = 0700
directory mask = 0700
available = yes
4、给共享目录加权限
sudo chmod 777 /smb
标签:samba,demo,sudo,添加,yes,安装,smb
From: https://www.cnblogs.com/linux-learn/p/16928320.html