Skip to content

don't override Port in ssh_config #11432

@LucaFilipozzi

Description

@LucaFilipozzi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugWG-RemotingPSRP issues with any transport layer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions