linux - Powershell 从 Linux 客户端连接到 Windows 远程

标签 linux powershell windows-10 remote-access

我正在尝试从我的 Linux 工作站远程连接到 Windows 机器。

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

在主机上:

启用 PSRemoting

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

检查一切:

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 工作站连接时:

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 事件日志中没有任何内容。

欢迎提出任何建议,

最佳答案

目前不支持来自 Linux/OSX 的 WinRM,但正在支持中。

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

关于linux - Powershell 从 Linux 客户端连接到 Windows 远程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43743601/

相关文章:

linux - 将所有非 HTTPS 请求重定向到 HTTPS

powershell - 在 PowerShell 中使用分隔符连接部件的最佳方法

tensorflow - 在 CPU 上运行 Tensorflow 比在 GPU 上运行速度更快

Linux : How to LIMIT incoming (concurrent) connection COUNT?

在多个操作系统上运行脚本的 Java 注意事项

android - 为android编译c程序

powershell - 更改CSV电子邮件地址

Powershell模拟键盘

Windows 10 相当于 LaunchAdvancedAssociationUI

python - 适用于 Windows 上的 Python 的 TensorRT