我正在尝试从我的 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,但正在支持中。
关于linux - Powershell 从 Linux 客户端连接到 Windows 远程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43743601/