V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
LxnChan
V2EX  ›  Linux

samba 共享问题

  •  
  •   LxnChan ·
    lxnchan · 2022-01-02 20:49:02 +08:00 · 1762 次点击
    这是一个创建于 844 天前的主题,其中的信息可能已经有所发展或是发生改变。

    smb.conf里面设置了文件夹可访问的用户,但是本机Windows上可以匿名访问,另外一台Ubuntu主机却不能。

    配置文件如下

    [global]
       workgroup = WORKGROUP
       server string = ust
       log file = /home/userme/logs/log.%m
       max log size = 1000
       logging = file
       panic action = /usr/share/samba/panic-action %d
       server role = standalone server
       obey pam restrictions = yes
       unix password sync = yes
       passwd program = /usr/bin/passwd %u
       passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
       pam password change = yes
       map to guest = bad user
       security = user
       usershare allow guests = no
    
    [userdisk777]
       comment = userdisk0
       path = /home/userme/userdisk0
       public = no
       read only = yes
       valid users = userme
       write list = userme
       ;invalid users = user1 user2
       create mask = 0777
       directory mask = 0777
    

    有大神能看出来是哪里出了问题吗

    第 1 条附言  ·  2022-06-20 07:58:35 +08:00
    6 条回复    2022-01-03 09:12:25 +08:00
    huntagain2008
        1
    huntagain2008  
       2022-01-02 21:02:58 +08:00 via iPhone
    本人小白,可以试试 testparm smb.conf 看看实际配置是否正确。
    weqopy
        2
    weqopy  
       2022-01-02 21:03:31 +08:00
    先开一下限制测试,public valid 这些,防火墙关一下,慢慢搞
    我之前是 linux 配置,Windows 访问,搞了挺长时间
    LxnChan
        3
    LxnChan  
    OP
       2022-01-02 21:13:24 +08:00
    @huntagain2008 配置文件没问题,`testparm`是没问题的
    LxnChan
        4
    LxnChan  
    OP
       2022-01-02 21:14:42 +08:00
    @weqopy Emmm...现在是 Windows 里面可以匿名访问,但是按照配置文件应该是不允许匿名的
    nbweb
        5
    nbweb  
       2022-01-03 08:55:27 +08:00   ❤️ 1
    [global]
    workgroup = WORKGROUP
    server string = Samba Server %v
    netbios name = debian
    security = user
    map to guest = bad user
    guest account = nobody
    dns proxy = no
    create mask = 0777
    directory mask = 0777
    force create mode = 0777
    force directory mode = 0777

    [Public]
    path = /mnt/Public
    browseable = yes
    public = yes
    available = yes
    oplocks = yes
    map archive = no
    guest ok = yes
    writable = yes

    这是我 debian 里面的,参考一下。
    LxnChan
        6
    LxnChan  
    OP
       2022-01-03 09:12:25 +08:00
    @nbweb 好的,谢谢。我看一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4004 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 05:17 · PVG 13:17 · LAX 22:17 · JFK 01:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.