我认为这更多是一个 Windows 配置问题。
目标:从 Linux访问 Windows 10公共共享。
在这种情况下:“服务器”是一个简单的独立 Windows 10 机器,“客户端”是 Debian 稳定版。
我在 Windows 10 计算机上共享一个文件夹。它与“每个人”共享,并且“每个人”都具有“读/写”访问权限。在文件夹属性对话框的安全选项卡中,“每个人”再次被授予“完全控制”。我特别希望每个人都可以公开访问此文件夹,IE创建特定用户不是一个选项。我可以从 Windows 中无密码 访问我的系统,但是,\\servername\sharename
我在从 Linux 机器安装共享文件夹时遇到问题。Windows 10 似乎强制要求注册用户进行访问。是这样吗?如何克服呢?我的Windows 10是企业版。
根据https://wiki.ubuntu.com/MountWindowsSharesPermanently
guest 表示您不需要密码即可访问共享
$ sudo mount.cifs //servername/sharename /media/windowsshare -o 'guest,iocharset=utf8'
mount error(13): Permission denied
# error log:
CIFS: Status code returned 0xc0000072 STATUS_ACCOUNT_DISABLED
以下是我尝试过的其他选项,来自我从互联网上找到的各种建议:
-o 'username=guest,password=,iocharset=utf8'
-o 'user=administrator,password='
-o 'username=Everyone,password=,iocharset=utf8'
-o 'sec=none,iocharset=utf8'
全部失败并出现各种错误:
CIFS: Status code returned 0xc0000072 STATUS_ACCOUNT_DISABLED
VFS: cifs_mount failed w/return code = -128
CIFS: Status code returned 0xc000006d STATUS_LOGON_FAILURE
VFS: cifs_mount failed w/return code = -13
CIFS: Status code returned 0xc0000022 STATUS_ACCESS_DENIED
VFS: cifs_mount failed w/return code = -13
我还尝试在 Windows 配置中的“来宾或公共”访问下启用文件共享,但它也不起作用。
请帮忙。
更新:
Windows 10 本地安全策略设置刚刚按照以下说明进行了更正:
现在:
$ sudo mount.cifs -v //servername/sharename /media/windowsshare -o 'guest,iocharset=utf8'
mount.cifs kernel mount options: ip=192.168.0.xx,unc=\\servername\sharename,iocharset=utf8,user=,pass=********
mount error(13): Permission denied
# error log:
CIFS: Status code returned 0xc0000022 STATUS_ACCESS_DENIED
CIFS: VFS: cifs_mount failed w/return code = -13
# and trying to add `,vers=2.1` will get the same result as well.
$ sudo mount.cifs //servername/sharename /media/windowsshare -o 'guest,iocharset=utf8,vers=1.0'
mount error: Server abruptly closed the connection.
This can happen if the server does not support the SMB version you are trying to use.
The default SMB version recently changed from SMB1 to SMB2.1 and above. Try mounting with vers=1.0.
mount error(112): Host is down
# error log:
[22997.487658] Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
[22997.494779] CIFS: VFS: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
[22997.505612] CIFS: VFS: cifs_mount failed w/return code = -112