You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
request: don't override Port directive in ssh_config
Similar to #11344, the StartSSHProcess() function always passes a -p <port> command line argument to the underlying operating system's ssh client even when -Port <port> is not passed to the *PSSession cmdlets.
This overrides the Port <port> directive that a system administrator might have set in an ssh_config file.
The ssh client already assumes port 22 and it is not necessary to provide a default port from the StartSSHProcess() function.
This is not as problematic as #11344 since sshd is typically deployed to listen on port 22. Nevertheless, it's not appropriate to override ssh_config directives unless -Port <port> is passed to cmdlets explicitly.
As a system administrator, I want to generate ssh configuration files containing directives that aren't overriden by PowerShell's invocation of ssh.
proposal: do not pass -p <port> to ssh client unless -Port <port> is passed to cmdlets
When invoking *PSSession cmdlets, if -Port <port> isn't used , then don't pass -p <port> as a command line argument to the ssh client.
Activity
LucaFilipozzi commentedon Dec 24, 2019
PowerShell/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Line 1920 in b7295de
PowerShell/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Line 1939 in b7295de
PowerShell/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Line 1959 in b7295de
SteveL-MSFT commentedon Dec 25, 2019
Do you want to submit a PR for this one as well?
LucaFilipozzi commentedon Dec 25, 2019
I have addressed this issue in pull request #11518.