Powershell connecting from linux client to remote window

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

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

On the host:

Enable-PSRemoting

Then allowed to all hosts with Set-Item wsman:\localhost\client\trustedhosts *

Checking everything:

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

Now when I try to connect from a 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

I do nothing in winrm windows event logs.

Any suggestions are welcome,

+4
source share
2 answers

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

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

+4
source

Remoting HTTP/HTTPS?

, :

winrm set winrm/config/client/auth @{Basic="true"}
winrm set winrm/config/service/auth @{Basic="true"}
winrm set winrm/config/service @{AllowUnencrypted="true"}

, HTTPS . : http://www.joseph-streeter.com/?p=1086

script, : https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1

0

Source: https://habr.com/ru/post/1676177/


All Articles