win10訪問samba配置共享目錄,踩坑記


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

  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

添加smba用戶
     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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM