以前都很顺利,突然报错,看似是认证没通过,也配置也用户密码,还是不行,折腾好久,记录一下:
配置过程:
安装
sudo apt-get install samba
sudo apt-get install cifs-utils
改配置
sudo vim
/etc/samba/smb
.conf
最后添加:
[share]
path = /home/username/Desktop/share #共享目录,提前建立好,chmod 777等
valid users = test
writable = yes
browseable = yes
sudo
touch
/etc/samba/smbpasswd
sudo
smbpasswd -a test
重启samba
sudo service smbd restart
win10下访问:
\\192.168.192.129\share
提示错误:
You can't access this shared folder because your organization's security policies block unauthenticated guest access.
These policies help protect your PC from unsafe or malicious devices on the network.
原因:
因为Window10 更新安全策略,默认禁止访问无密码的Samba共享
解决:
在Samba中增加用户名密码配置, 并在配置文件smb.conf
中注释掉 map to guest = bad user
如:
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
#map to guest = bad user
配置多个共享目录:在后面挨个加,如下:注意名称
[share]
path = /home/test/Desktop/share
valid users = test
writable = yes
browseable = yes
[Public]
path = /home/test/Public
valid users = test
writable = yes
browseable = yes
win10下访问:
\\192.168.192.129\Public