本文介绍了Powershell从Linux客户端连接到Windows远程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Linux工作站远程连接到Windows计算机.

I am trying to remotely connect to a windows machine from my Linux workstation.

我在Arch Linux工作站上安装了powershell,目前正在尝试连接到主机.

I installed powershell on my Arch Linux workstation and I am currently trying to connect to the host.

在主机上:

启用PSRemoting

然后允许所有主机与设置项wsman:\ localhost \ client \ trustedhosts *

使用以下方法检查所有内容:

Checking everything with:

PS C:\windows\system32> ls WSMan:\localhost\shell


   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Shell

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   AllowRemoteShellAccess                         true
System.String   IdleTimeout                                    7200000
System.String   MaxConcurrentUsers                             2147483647
System.String   MaxShellRunTime                                2147483647
System.String   MaxProcessesPerShell                           2147483647
System.String   MaxMemoryPerShellMB                            2147483647
System.String   MaxShellsPerUser                               2147483647

现在,当我尝试从Linux工作站进行连接时:

Now when I try to connect from Linux workstation:

PS /home/user/tmp> Enter-PSSession -ComputerName "myuser" -Credential DOMAIN\myuser

Windows PowerShell credential request
Enter your credentials.
Password for user DOMAIN\myuser: *****************

Enter-PSSession : MI_RESULT_ACCESS_DENIED
At line:1 char:1
+ Enter-PSSession -ComputerName "myuser" -Credential DOMAIN\ajpalhare ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (myuser:String) [Enter-PSSession
   ], PSInvalidOperationException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

winrm Windows事件日志中没有任何内容.

I don't anything on the the winrm windows event logs.

欢迎提出任何建议,

推荐答案

目前不支持Linux/OSX上的WinRM,但正在提供支持.

WinRM from Linux/OSX is not currently supported but support is on the way.

https://github.com/PowerShell/PowerShell/issues/942

这篇关于Powershell从Linux客户端连接到Windows远程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 21:52