Error thrown when initiating NEW-PSSession to Centos Linux #32

Open
energizedtech opened this Issue Oct 12, 2016 · 9 comments

Projects

None yet

2 participants

@energizedtech

Clean compile of OMI and PSL-OMI-Provider
Providing userid of root and matching password when prompted for Get-Credential on Windows.

PS D:> $o=New-PSSessionOption -SkipCACheck -SkipRevocationCheck -SkipCNCheck
PS D:> New-PSSession -Computername 10.254.0.130 -Credential $c -Authentication basic -UseSSL -SessionOption $o
New-PSSession : The type initializer for 'System.Management.Automation.ConfigPropertyAccessor' threw an exception.
At line:1 char:1

  • New-PSSession -Computername 10.254.0.130 -Credential $c -Authenticati ...
  • - CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], RemoteException
    - FullyQualifiedErrorId : PSSessionOpenFailed
    
@energizedtech

Windows 10 PowerShell 5 as Client connecting to PowerShell on CentOS Linux

@andschwa
Member

PowerShell version? Try building the Linux one from master.

@energizedtech

I just redid the process with Ubuntu, didn't re-compile from GitHub. Exact same error

@energizedtech

In both cases the Calling Workstation (Windows 10 x64)

Name Value


PSVersion 5.1.14393.206
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.206
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

@energizedtech

When you say rebuild are you referring to OMI, PSRP or POWERSHELL on Linux?

@energizedtech

For authentication should it be
root@ipaddress or simply root ?

@energizedtech

Running OMI regression test now...

@energizedtech

Just added PowerShell 6.0 to the equation on Windows 10

@andschwa
Member

When you say rebuild are you referring to OMI, PSRP or POWERSHELL on Linux?

Sorry, yes I mean PowerShell on Linux.

For authentication should it be root@ipaddress or simply root ?

It should be just the user, root.

New-PSSession : The type initializer for 'System.Management.Automation.ConfigPropertyAccessor' threw an exception.

This is an error we've previously resolved, but has not yet made it into releases. There were two parts:

  1. The PSRP provider was not properly impersonating the expected user, so it would start PowerShell with HOME=/root (the home of root, the user that launched the OMI daemon since it's a service) but run with the user rights of someuser which could not read/write to /root. In #31 I fixed the PSRP provider to set HOME to the home of the user being impersonated, to avoid this permission issue. I don't know if it's in the current package.

  2. PowerShell would crash on start-up because of a regression that required the HOME directory to be readable. This was fixed in PowerShell/PowerShell#2387, which I know didn't make into the alpha.10 release.

Just added PowerShell 6.0 to the equation on Windows 10

I would not do this, it's an extra variable. No work has been done to ensure that PowerShell Core 6.0 remoting works (I mean, I think it does, but I've not personally tested it).

Anyway, what version of PowerShell on Linux are you using, and how are you launching OMI and connecting? Can you post some copy-pastes of your commands?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment