Leehm

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
以前都很顺利,突然报错,看似是认证没通过,也配置也用户密码,还是不行,折腾好久,记录一下:
 
配置过程:
 
安装

  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

 

posted on 2020-09-22 15:04  Leehm  阅读(4327)  评论(1编辑  收藏  举报