Jirajine
V2EX  ›  Windows

Windows Explorer 无法访问 samba 共享

By Jirajine at 2019 年 10 月 30 日 · 3529 次点击

Win10 1809,服务器 samba 版本是 3.6.25 先上 smb.conf 配置:

[global]
        netbios name = OpenWrt
        display charset = UTF-8
        interfaces = lo br-lan
        server string = OpenWrt
        unix charset = utf-8
        workgroup = WORKGROUP
        bind interfaces only = yes
        deadtime = 30
        enable core files = no
        #invalid users = root
        local master = yes
        map to guest = Bad User
        max protocol = SMB2
        min receivefile size = 16384
        null passwords = yes
        passdb backend = smbpasswd
        security = user
        smb passwd file = /etc/samba/smbpasswd
        socket options = TCP_NODELAY IPTOS_LOWDELAY

        # Some other performace tuning options
        # disable links and symbol links
        follow symlinks = no
        wide links = no
        # enable some read/write tuning
        use sendfile = yes
        read raw = yes
        write raw = yes
        aio read size = 16384
        aio write size = 16384
        write cache size = 262144
        max xmit = 65536
        large readwrite = yes
        getwd cache = yes

[sda2]
        path = /mnt/sda2
        valid users = root
        read only = no
        guest ok = no
        create mask = 022
        directory mask = 022
        browseable = yes
        

经测试其他设备可以正常连接,但 Windows 在 explorer 中输入\\{ip or hostname} 始终提示找不到主机,无论开启关闭 windows 的 smb1 功能。

但使用命令 net use \\OpenWrt\sda2 {password} /user:root 后可以正常连接,也可以在 explorer 中正常打开和映射网络驱动器。

目前的解决方法是把那条命令写进 bat 脚本扔 startup 里,很难受并且开机还会闪一下黑框。

目前尚无回复
© 2026 V2EX · 24ms · 3.9.8.5