以前都很順利,突然報錯,看似是認證沒通過,也配置也用戶密碼,還是不行,折騰好久,記錄一下:
配置過程:
安裝
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