在 Windows 10 上访问公共 Samba 共享时访问被拒绝

在 Windows 10 上访问公共 Samba 共享时访问被拒绝

我正在尝试配置 Samba 以公开共享网络上的文件夹,但我还想要私人文件夹。我遇到了一个问题,当我创建 Samba 帐户时,如果您以 Samba 用户身份登录,则无法访问所有共享。我从 Windows 10 PC 连接文件系统正在运行 Devuan 2.0.0(Debian 的一个分支)

以下是 samba.conf 中包含的内容

[global]
    workgroup = WORKGROUP 
    dns proxy = no
    map to guest = Bad User
    log file = /var/log/samba/log.%m
    max log size = 100
    server role = standalone server
    passdb backend = tdbsam
    obey pam restrictions = yes
    unix password sync = yes
    passwd program = /usr/bin/passwd %u
    pam password change = yes
    map to guest = bad user
    usershare allow guests = yes
    unix extensions = no
    
[Public]
    comment = pubic share
    hosts allow = 1.1.1.100/24, 127.0.0.1
    hosts deny = 0.0.0.0/0
    path = /mnt/Niflheim/Public
    public = yes
    read only = yes
    guest ok = yes
    guest only = no
    
[Private]    
    comment = home share
    hosts allow = 1.1.1.100/24, 127.0.0.1
    hosts deny = 0.0.0.0/0
    path = /mnt/Niflheim/Home
    valid users = USER, @USERGROUP
    read only = no
    browsable = no
    writeable = yes
    writeable list = USER

举例来说,如果我创建一个名为 USER 的 Samba 帐户并以该帐户登录,那么我就无法访问任何共享,但如果我不登录,则所有公共共享都可用。

答案1

事实证明,这只是我的电脑出了问题,而不是 smb 共享出了问题。我的电脑与 dns 服务器的通信方式出了问题,

只需重新安装 Windows 即可修复

相关内容