PowerShell / PowerShell/PowerShell

New-PSSession ip v6 linux2linux Invalid argument

Open
#23,992 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs-Triage
Dominant language
C#
Stars
55.5k
Forks
8.5k
Avg merge
1d 2h
Merged PRs (30d)
88

Description

Prerequisites
Steps to reproduce

New-PSSession -HostName [fe80::215:5dff:fe15:5934] -UserName root -KeyFilePath '/root/.ssh/id_rsa'

Expected behavior
return a new PSSession
Actual behavior
New-PSSession: [[fe80::215:5dff:fe15:5934]] The background process reported an error with the following message: The SSH client session has ended with error message: ssh: connect to host fe80::215:5dff:fe15:5934 port 22: Invalid argument.
Error details
Exception             : 
    Type        : System.Management.Automation.Remoting.PSRemotingTransportException
    ErrorCode   : 2100
    ErrorRecord : 
        Exception             : 
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : The background process reported an error with the following message: The SSH 
client session has ended with error message: ssh: connect to host fe80::215:5dff:fe15:5934 port 22: Invalid argument.
            HResult : -2146233087
        CategoryInfo          : ResourceUnavailable: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException
    Message     : The background process reported an error with the following message: The SSH clie
nt session has ended with error message: ssh: connect to host fe80::215:5dff:fe15:5934 port 22: Invalid argument.
    HResult     : -2146233087
TargetObject          : System.Management.Automation.RemoteRunspace
CategoryInfo          : OpenError: (System.Management.A…tion.RemoteRunspace:RemoteRunspace) [New-PSSession
], PSRemotingTransportException
FullyQualifiedErrorId : 2100,PSSessionOpenFailed
ErrorDetails          : [[fe80::215:5dff:fe15:5934]] The background process reported an error with the fol
lowing message: The SSH client session has ended with error message: ssh: connect to host fe80::215:5dff:fe15:5934 po
rt 22: Invalid argument.
InvocationInfo        : 
    MyCommand        : New-PSSession
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 3
    Line             : New-PSSession -HostName "[fe80::215:5dff:fe15:5934]" -UserName root -KeyFilePath '/
root/.ssh/id_rsa'
    PositionMessage  : At line:1 char:1
                       + New-PSSession -HostName "[fe80::215:5dff:fe15:5934]" -UserName root - …
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : New-PSSession
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
# server:
"Rocky Linux 9.2"
sshd_config:
Subsystem powershell /usr/bin/pwsh -sshs -NoLogo -NoProfile
UseDNS no

# client:
linux + powershell 7.4.3  to server ipv6 addr ,problem
linux + powershell 7.2.21 to server ipv6 addr ,problem


# normal
win + PowerShell 7.5.0-preview.2  ssh to server ipv6 addr  ,normal
linux + powershell 7.2.21 to server ipv4 addr ,normal
linux client tcping server ipv6 22 port,normal
Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported New-PSSession command on the Linux client and Rocky Linux 9.2 server, comparing the failing IPv6 connection with the working IPv4 and Windows cases. Trace the SSH remoting path that handles the bracketed link-local address and verify the fix by successfully creating a PSSession over IPv6 without regressing the other cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, linux
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.