Skip to content

Enter-PSsession fails CentOS 7.1 to Win 2012 R2 #2525

Closed

Description

I have installed OpenSSH and PowerShell 6.0.0.11 on my Windows 2012 system and PowerShell 6.0.0.11 on my Centos server but SSH works fine to the windows server so I know that is working and I am seeing the authorizations in my sshd.log but I get the following error any time I connect using Enter-PSsession

Enter-PSSession : The background process reported an error with the following 
message: "The named pipe target process has ended.".
At line:1 char:1
+ Enter-PSSession -HostName 172.17.17.227 -UserName administrator
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Enter-PSSession], PSRe 
   motingTransportException
    + FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemoting 
   DataStructureException,Microsoft.PowerShell.Commands.EnterPSSessionCommand

I do have the subsystem for PowerShell defined in SSHD as follows

Subsystem powershell C:/Program Files/PowerShell/6.0.0.11/powershell.exe -sshs -NoLogo -NoProfile

I did run the Install-PowerShellRemoting.ps1 from an admin level powershell 6 shell

Steps to reproduce

any attempt to use Enter-PSsession

Expected behavior

I should recieve a PS On my windows system

Actual behavior

Session Terminates with the following error

Enter-PSSession : The background process reported an error with the following 
message: "The named pipe target process has ended.".
At line:1 char:1
+ Enter-PSSession -HostName 172.17.17.227 -UserName administrator
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Enter-PSSession], PSRe 
   motingTransportException
    + FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemoting 
   DataStructureException,Microsoft.PowerShell.Commands.EnterPSSessionCommand

Environment data

Name                           Value                                           
----                           -----                                           
PSVersion                      6.0.0-alpha                                     
PSEdition                      Core                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                         
BuildVersion                   3.0.0.0                                         
GitCommitId                    v6.0.0-alpha.11                                 
CLRVersion                                                                     
WSManStackVersion              3.0                                             
PSRemotingProtocolVersion      2.3                                             
SerializationVersion           1.1.0.1  

Activity

  1. MaximoTrinidad commented on Oct 23, 2016

    @MaximoTrinidad

    This is a known and could be duplicate issue: #2473
    Just prove that powershell-v6.0.0-alpha.11 still can't connect Linux to a Windows OS.
    :)

  2. robertforbes68 commented on Oct 24, 2016

    @robertforbes68
    Author

    The error there is not being able to establish an SSH, as you see I am actually establishing an SSH and then powershell is dying out. Different issues IMO

  3. MaximoTrinidad commented on Oct 24, 2016

    @MaximoTrinidad

    Agreed! That's why I said "could be duplicate issue". Still I've seen different error messages with SSH. And, in my case I was trying to connect from Ubuntu. The end result still is "Linux can't connect to Windows PowerShell using Open-SSH" .

    I'm think out loud... I wonder if is some more on the Windows side (some missing settings) than Linux. I got it almost to the point of connecting but still failed.

    :)

  4. PaulHigin commented on Oct 25, 2016

    @PaulHigin
    Contributor

    Always check the error record for exception and inner exceptions as they can many times provide more detailed information of the problem.

    $err = $error[0]
    $err.Exception
    $err.Exception.InnerException

    If Linux -> Windows SSH remoting broke recently it may be related to this issue (#2531), where a recent change in Win32-OpenSSH breaks Windows as a target for SSH remoting. But it still works as a client for Windows -> Linux remoting. I'll try to submit a PR this week that fixes the problem. The workaround is to not install the latest release of Win32-OpenSSH.

  5. PaulHigin commented on Oct 25, 2016

    @PaulHigin
    Contributor

    To expand on my comment some, PowerShell remoting uses SSH as a secure transport and any errors that SSH reports are wrapped in a transport/remoting exception. So you need to look for the contained inner exception to get the original SSH error message.

    I have been running PS remoting Linux (Ubuntu 14) -> Windows successfully for weeks now as long as I can make an SSH connection to the target Windows machine. The only exception is the recent issue I describe above when I installed the latest version of Win32-OpenSSH.

  6. robertforbes68 commented on Oct 25, 2016

    @robertforbes68
    Author

    Thanks Paul, I'll rollback to a previous Open-SSH version, I am also
    running the Win64 build of OpenSSH. I have no issues directly SSHing to the
    windows box the issue is solely with remoting.

    On Tue, Oct 25, 2016 at 11:45 AM, Paul Higinbotham <notifications@github.com

    wrote:

    To expand on my comment some, PowerShell remoting uses SSH as a secure
    transport and any errors that SSH reports are wrapped in a
    transport/remoting exception. So you need to look for the contained inner
    exception to get the original SSH error message.

    I have been running PS remoting Linux (Ubuntu 14) -> Windows successfully
    for weeks now as long as I can make an SSH connection to the target Windows
    machine. The only exception is the recent issue I describe above when I
    installed the latest version of Win32-OpenSSH.

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2525 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AGKvCD79l408-sm5R9ZaOmbHFqrP507lks5q3iQGgaJpZM4KeBkS
    .

  7. robertforbes68 commented on Oct 25, 2016

    @robertforbes68
    Author

    Could be. I'll try ubuntu when I get off this plane :)

    On Monday, October 24, 2016, Maximo Trinidad notifications@github.com
    wrote:

    Agreed! That's why I said "could be duplicate issue". Still I've seen
    different error messages with SSH. And, in my case I was trying to connect
    from Ubuntu. The end result still is "Linux can't connect to Windows
    PowerShell using Open-SSH" .

    I'm think out loud... I wonder if is some more on the Windows side (some
    missing settings) than Linux. I got it almost to the point of connecting
    but still failed.

    :)

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2525 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AGKvCI6PlOJwek1ulKM_jWevkgOtGdAsks5q3PC2gaJpZM4KeBkS
    .

  8. robertforbes68 commented on Oct 25, 2016

    @robertforbes68
    Author

    One quick question could you send me a copy of your sshd.config from the
    OpenSSH-Win32 directory, I've seen several different ways to format the
    subsystem lines and I am wondering if that is what is breaking mine. I have
    tried both Win32 and Win64 and both 010 and 020 builds but no joy on
    powershell remoting over SSH from Linux to Windows :(

    Robert

    On Tue, Oct 25, 2016 at 11:45 AM, Paul Higinbotham <notifications@github.com

    wrote:

    To expand on my comment some, PowerShell remoting uses SSH as a secure
    transport and any errors that SSH reports are wrapped in a
    transport/remoting exception. So you need to look for the contained inner
    exception to get the original SSH error message.

    I have been running PS remoting Linux (Ubuntu 14) -> Windows successfully
    for weeks now as long as I can make an SSH connection to the target Windows
    machine. The only exception is the recent issue I describe above when I
    installed the latest version of Win32-OpenSSH.

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2525 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AGKvCD79l408-sm5R9ZaOmbHFqrP507lks5q3iQGgaJpZM4KeBkS
    .

  9. robertforbes68 commented on Oct 25, 2016

    @robertforbes68
    Author

    Ahhh I saw a video of some MS guys showing Linux connecting to Windows in
    just this fashion.

    On Sun, Oct 23, 2016 at 4:49 PM, Maximo Trinidad notifications@github.com
    wrote:

    This is a known and could be duplicate issue: #2473
    #2473
    Just prove that powershell-v6.0.0-alpha.11 still can't connect Linux to a
    Windows OS.
    :)

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2525 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AGKvCEzxIjB4Ju5dC7AjyQ_h1CFffqACks5q28h2gaJpZM4KeBkS
    .

  10. added
    WG-Remoting
    on Oct 25, 2016
  11. added this to the milestone on Oct 25, 2016
  12. joeyaiello commented on Oct 25, 2016

    @joeyaiello
    Contributor

    Closing as a dupe of #2473

  13. rob-scheepens commented on Apr 28, 2017

    @rob-scheepens

    Has anyone got his working yet? Setting DEBUG3 LogLevel seems to show the named pipe is disconnected (109), accompanied by an invalid handle error (6):

    3792 12:30:21 608 agent_start pid:3792, dbg:0, child:0, pipe:0
    3792 12:30:55 109 client pid 4804 connected
    3792 12:30:55 109 debug1: spawned worker 2436 for agent client pid 4804
    2436 12:30:55 109 agent_start pid:2436, dbg:0, child:1, pipe:512
    2436 12:30:55 109 debug3: connection io 000001FCDAE0C530 #bytes:0 state:0
    2436 12:30:57 577 debug3: connection io 000001FCDAE0C530 #bytes:4 state:1
    2436 12:30:57 577 debug3: connection io 000001FCDAE0C530 #bytes:44 state:2
    2436 12:30:57 577 debug2: client type: 3
    2436 12:30:57 577 debug1: process agent request type 200
    2436 12:30:57 609 debug3: connection io 000001FCDAE0C530 #bytes:8 state:3
    2436 12:30:57 843 debug1: iocp error: 109 on 000001FCDAE0C530 \n
    2436 12:30:57 843 debug1: connection 000001FCDAE0C530 clean up
    2436 12:30:57 843 debug1: iocp error: 6 on 0000000000000000 \n
    

    I'd really like remoting to work properly from Linux to Windows. ;)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateWG-Remoting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions