1

我正在尝试在新服务器(服务器 C)上使用 CREDSSP

我已经在另外两台服务器上成功设置了 credssp。(服务器 A 到服务器 B)

我现在正在尝试使用 CREDSSP 从服务器 A 连接到服务器 C,但无论我做什么,我都会收到以下错误:

[SERVER_C.domain.edu] 连接到远程服务器 SERVER_C.domain.edu 失败并显示以下错误消息:访问被拒绝。有关详细信息,请参阅 about_Remote_Troubleshooting 帮助主题。+ CategoryInfo : OpenError: (SERVER_C.domain.edu:String) [], PSRemotingTransportException + FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken

这是我从服务器 A 到服务器 B 的完美查询:

# Setting the Credentials to be used to sign into the Server B. 
    $pass = ConvertTo-SecureString "Password" -asplaintext -force
    $mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist "domain\user.service",$pass
#
#
# The Remote Execution Command. Fully Qualified Domain name is critical since we are using Credssp.
# Credssp is being used to resolve an issue with a double hop authentication issue. Other steps setup on each computer had to be completed before Credssp would work
   Invoke-Command -ComputerName SERVER_B.domain.edu -command { C:\helloWorld.ps1 } -Authentication Credssp  -Credential $mycred

我已经仔细检查了服务器 C(新服务器)和服务器 B(旧服务器)之间我能想到的所有内容,但我找不到任何我收到错误的原因。

我知道,如果我取出 CREDSSP 部分,脚本可以工作,除非涉及双跳。所以服务器肯定是连接的。

我确保运行以下命令:

Enable-psremoting

Set-ExecutionPolicy -Scope localMachine -ExecutionPolicy RemoteSigned

Enable-WSManCredSSP -Role Client -DelegateComputer '*.reskit.org' –Force 
Enable-WSManCredSSP -Role Server –Force

wsman

还遵循了这些步骤:使用 gpedit.msc 并查看以下策略:计算机配置 -> 管理模板 -> 系统 -> 凭据委派 -> 允许委派新凭据。验证它是否已启用并使用适合目标计算机的 SPN 进行配置。例如,对于目标计算机名称“myserver.domain.com”,SPN 可以是以下之一:WSMAN/myserver.domain.com 或 WSMAN/*.domain.com。有关详细信息,请参阅 about_Remote_Troubleshooting 帮助主题。

正如我所提到的,我知道服务器 A 设置正确,因为我将上面的脚本运行到服务器 B 没有问题。

任何建议将不胜感激。

我唯一的想法是服务器 A 和 B 正在运行 Powershell 3,而服务器 C 正在运行 Powershell 5

4

1 回答 1

0

我注意到 Enable-WSManCredSSP -Role Client 命令使用 *.reskit.org 而不是 *.domain.eu.(?)

对我来说,在服务器或客户端运行哪些命令并不完全清楚,但乍一看还可以。我最近配置了credssp也是为了解决双跳问题,如下:

在服务器上:

Enable-WSManCredSSP -Role Server -Force

Get-WSManCredSSP 显示:计算机未配置为允许委派新凭据。此计算机配置为从远程客户端计算机接收凭据。

在客户端:

winrm quickconfig
Enable-WSManCredSSP -role client *.mydomain.com

Get-WSMancredSSP 显示:计算机配置为允许将新凭据委派给以下目标:wsman/*.mydomain.com。此计算机未配置为从远程客户端计算机接收凭据。

我的客户端脚本通过以下方式启动显式远程会话:

$session = New-PSSession -Computer $computerName -Credential $credential -Authentication Credssp
于 2018-05-22T19:36:44.780 回答