-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
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.