Windows Explorer 无法访问 samba 共享

2019-10-30 15:14:44 +08:00
 Jirajine

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 里,很难受并且开机还会闪一下黑框。

2736 次点击
所在节点    Windows
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/614487

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX