sudo apt-get install samba
sudo vim /etc/samba/smb.conf
希望访问者通过账号密码登录后访问共享文件夹
①.添加linux系统用户share
sudo useradd share
②.设置share用户的密码
sudo smbpasswd -a share
③.配置文件修改为
[share]
path = /home/share #文件夹路径
available = yes
browseable = yes
public = yes
writable = yes
valid users = share
重启smbd服务
sudo service smbd restart
参考:
https://blog.csdn.net/qq_41004932/article/details/117486105
https://blog.csdn.net/weixin_44178072/article/details/127185130
不新建账号就从 ②开始
②.设置share用户的密码
sudo smbpasswd -a lml
③.配置文件修改为
[datapool]
path = /datapool
available = yes
browseable = yes
public = yes
writable = yes
valid users = lml
重启smbd服务
sudo service smbd restart