bor*_*tao 3 samba network-shares windows-10
当我想要访问无密码网络共享时,Windows 10 会提示我输入密码。共享位于 NAS(SMB 协议)上。我可以从其他操作系统/系统访问共享,无需任何密码。我可以在提示符上输入任何内容,它就会接受。
显示其他错误:指定的登录会话不存在。它可能已经被终止了。
我尝试过的事情:
以下是smb.conf
根据要求从 NAS 获取的:
[global]
dos charset = CP437
unix charset = UTF-8
display charset = UTF-8
netbios name = mynas
server string = "LinkStation"
socket options = TCP_NODELAY
max xmit = 65536
use sendfile = yes
os level = 1
wins server =
workgroup = WORKGROUP
security = user
auth methods = guest sam
passdb backend = tdbsam:/etc/samba/smbpasswd.tdb
encrypt passwords = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
unix password sync = yes
unix extensions = no
guest account = nobody
null passwords = yes
guest only = no
password level = 14
map to guest = Bad User
veto files = /.AppleDesktop/Network Trash Folder/TheVolumeSettingsFolder/.AppleDouble/.AppleDB/.com.apple.timemachine.supported/
delete veto files = yes
deadtime = 15
invalid users = mail, deamon
admin users = root
username map = /etc/samba/smbusers
log level = 1
max log size = 0
lock directory = /etc/samba/lock
dos filetimes = Yes
dos filetime resolution = No
map archive = Yes
map hidden = No
map system = No
dns proxy = No
show add printer wizard = No
host msdfs = no
disable spoolss = yes
wide links = yes
lanman auth = yes
printcap name = /etc/printcap
load printers =
Run Code Online (Sandbox Code Playgroud)
这是smbusers
# Unix_name = SMB_name1 SMB_name2 ...
root = administrator
nobody = guest pcguest smbguest
Run Code Online (Sandbox Code Playgroud)
由于 Windows 10 版本 1709 以及转发 SMB2 和 SMB3 默认情况下禁用来宾访问,作为连接到 SMB 服务器的客户端,强制来宾或未经身份验证的凭据。
下面引用和引用的是与您的问题相关的 Microsoft 帖子的部分内容。我鼓励您仔细阅读其全部内容。
我还在下面发布了一些“潜在的解决方案”来寻求答案,尽管出于安全原因微软表示不要这样做。您应该确保您的网络被锁定,以防止相关系统受到中间人攻击。
症状
从 Windows 10 版本 1709 和 Windows Server 2019 开始,SMB2 和 SMB3 客户端默认不再允许以下操作:
- 访客帐户访问远程服务器。
- 提供无效凭据后,回退到来宾帐户。
SMB2 和 SMB3 在这些版本的 Windows 中具有以下行为:
- 默认情况下,Windows 10 企业版和 Windows 10 教育版不再允许用户使用来宾凭据连接到远程共享,即使远程服务器请求来宾凭据也是如此。
注意:只要 安装了KB5003173 ,此 Windows 10 行为就会出现在 Windows 10 1709、Windows 10 1803、Windows 10 1903、Windows 10 1909 以及 Windows 10 2004、Windows 10 20H2 和 Windows 10 21H1 中 。
如果您尝试连接到请求访客凭据而不是适当的经过身份验证的主体的设备,您可能会收到错误消息。
此外,如果远程服务器尝试强制您使用来宾访问,或者管理员启用来宾访问,则会在 SMB 客户端事件日志中记录以下条目:
Run Code Online (Sandbox Code Playgroud)Log Name: Microsoft-Windows-SmbClient/Security Source: Microsoft-Windows-SMBClient Date: Date/Time Event ID: 31017 Task Category: None Level: Error Keywords: (128) User: NETWORK SERVICE Computer: ServerName.contoso.com Description: Rejected an insecure guest logon. User name: Ned Server name: ServerName
指导
此事件表示服务器尝试以未经身份验证的访客身份登录用户,但被客户端拒绝。访客登录不支持标准安全功能,例如签名和加密。因此,访客登录很容易受到中间人攻击,从而暴露网络上的敏感数据。默认情况下,Windows 禁用不安全(不安全)的来宾登录。我们建议您不要启用不安全的访客登录。
原因
这种默认行为的更改是设计使然,并且是 Microsoft 出于安全原因建议的。
注意:如果进行任何这些更改,请重新启动系统,然后在重新启动后重试。有时,要在 Windows 中生效,需要在更改注册表或组策略后重新启动。
First, use this PowerShell to enable, disable, or remove the AllowInsecureGuestAuth
$x = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name "AllowInsecureGuestAuth";
If ($x) {
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name "AllowInsecureGuestAuth" -Value 1 -Force;
} Else {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name "AllowInsecureGuestAuth" -PropertyType "DWORD" -Value 1 -Force;
}
Run Code Online (Sandbox Code Playgroud)
Note: You can undo this by changing the -Value 1
code to -Value 0
Second, you can try to uninstall the KB5003173 as per the post that says this is the update that makes this security change effective.
Third, you could try to set the local or domain Group Policy to enable insecure guest access with settings:
Fourth, following applicable steps on the How to detect, enable and disable SMBv1, SMBv2, and SMBv3 in Windows post you could try to enabled SMBv1. Or you could enable SMBv1 and then disable SMBv2, and SMBv3 to see if that forces the SMBv1 to be used that doesn't have the security constraint.
第五,在按照上述步骤设置注册表选项时要尝试的另一件事是,设置完成后重新启动后,将运行一两个命令行,但不提升为管理员。
Run Code Online (Sandbox Code Playgroud)net use * /delete
/user:guest
可能需要/user:<remoteMachineIPAddress>\guest
Run Code Online (Sandbox Code Playgroud)net use \\serverName\shareName "" /user:guest /persistent:yes net use \\serverName\shareName /user:guest "" /persistent:yes
使用上述两种格式之一,同时考虑有关/user:XX.XX.XX.XX\guest
使其与远程 SMB/NAS 系统的实际 IP 相匹配的注释,这可能允许后续连接,而无需每次重新键入凭据。
您应该重新启动进行测试,看看此解决方案在重新启动后是否仍然存在。考虑将其添加为登录脚本或将适用的逻辑删除到/startup
Windows 中的文件夹中,以便在重新启动后需要再次重新运行时,它可以在每个(或所需的)用户登录时运行。
注意: 将副本放入该C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
目录中。
@ECHO OFF
IF NOT DEFINED MINIMIZED SET MINIMIZED=1 && START "" /MIN "%~F0" x && EXIT
net use \\serverName\shareName /user:guest "" /persistent:yes
EXIT
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
18889 次 |
最近记录: |