我正在使用ssh登录到其他 Windows 机器。我正在尝试pssession在localhost. 但我不能在正常的豪华提示下做到这一点:
$ New-PSSession
New-PSSession : [localhost] Connecting to remote server localhost failed with the
following error message : Access is denied. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession
+ ~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspa
ce) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
Run Code Online (Sandbox Code Playgroud)
看来我必须在一个高架的豪华外壳上。没有管理员权限,有没有办法做到这一点?
当我user以与服务器相同的身份登录时,我可以Enter-PSSession:
> Enter-PSSession -ConnectionURI http://xxx.xx.xxx.xx:5985
Run Code Online (Sandbox Code Playgroud)
但是,当我以不同的用户身份(在同一台机器上)登录并尝试Enter-PSSession使用-Credential参数时:
> Enter-PSSession -ConnectionUri http://xxx.xx.xxx.xx:5985 -Credential user
Run Code Online (Sandbox Code Playgroud)
输入密码后,我得到:
Enter-PSSession : Connecting to remote server xxx.xx.xxx.xx failed with the
following error message : Access is denied. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ConnectionUri http://xxx.xx.xxx.xx:5985 -Credential user
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (http://xxx.xx.xxx.xx:5985/:Uri
) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
Run Code Online (Sandbox Code Playgroud)