问题描述
同一局域网,电脑A为Windows LTSC2019系统,可以访问C黑群晖的smb共享,但无法访问D Debian11的smb共享。电脑B为Windows 10家庭版,可以正常访问C D两个设备的smb共享。
错误代码
0x80004005
说明
这个错误代码有其它可能性,下面的方法不一定能1000%解决你所遇到的问题。
在Debian11 的smb共享文件配置中,默认支持匿名用户访问。如果不输入用户名,则映射为nobody用户。而LTSC属于服务器类型,对此类权限比较敏感,默认不支持匿名用户登录。
解决方法(推荐)
修改map to guest =
If set to Bad User, allows users without accounts on the Samba system to log in and be assigned the guest account. This option can be used as part of making public shares for anyone to use. If set to Bad Password, users who mistype their passwords will be logged in to the guest account instead of their own. Because no warning is given, the Bad Password value can be extremely confusing: we recommend against it. The default setting of Never prevents users without accounts from logging in.
nano /etc/samba/smb.conf map to guest = never
smb登录后,默认不允许对个人用户目录进行操作,是只读的。同步这里处理一下啊,修改read only =
[homes] comment = Home Directories browseable = no # By default, the home directories are exported read-only. Change the # next parameter to 'no' if you want to be able to write to them. read only = no
个人创建的共享文件夹例如下面。放在配置文件最后就可以了。当然,记录write list里面是你的smba账户
[ST2R8] path = /mnt/ST2R8/ guest ok = no browseable = yes write list = lyes
最后重启服务systemctl restart smbd.service
解决方法(不推荐)
win+R,输入“gpedit.msc”打开本地组策略编辑器
菜单路径寻找:
计算机配置》管理末班》网络》Lanman工作站
找到项目:“启用不安全的来宾登录”,配置为“已启用”,重启。