我试图在新服务器(服务器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并查看以下策略:计算机配置->管理模板-> System ->凭据委托->允许委派新凭据。验证是否启用并配置了适合目标计算机的SPN。例如,对于目标计算机名"myserver.domain.com",SPN可以是以下内容之一: WSMAN/myserver.domain.com或WSMAN/*.domain.com。有关更多信息,请参见about_Remote_Troubleshooting帮助主题。
正如我提到的,我知道服务器A的设置是正确的,因为我没有问题地运行上面的脚本到服务器B。
如有任何建议,我们将不胜感激。
我唯一的想法是服务器A和B运行Powershell 3,服务器C运行Powershell 5
发布于 2018-05-22 19:36:44
我注意到启用-WSManCredSSP -Role客户端命令使用*.reskit.org而不是*.domain.eu。(?)
对我来说,还不完全清楚哪些命令是在服务器上运行的,还是在客户机上运行的,但乍一看还可以。我最近还配置了credssp来解决双跳问题,如下所示:
服务器上的:
Enable-WSManCredSSP -Role Server -Force显示:机器没有配置为允许委派新的凭据。此计算机配置为从远程客户端计算机接收凭据。
客户机上的:
winrm quickconfig
Enable-WSManCredSSP -role client *.mydomain.com显示:机器被配置为允许将新凭据委托给以下目标: wsman/*.mydomain.com。此计算机未配置为从远程客户端计算机接收凭据。
我的客户端脚本通过以下方式启动一个显式远程会话:
$session = New-PSSession -Computer $computerName -Credential $credential -Authentication Credssphttps://stackoverflow.com/questions/50419727
复制相似问题