Skip to content

don't override Port in ssh_config #11432

Closed

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.

Activity

  1. added
    Issue-Enhancement
    on Dec 24, 2019
  2. LucaFilipozzi commented on Dec 24, 2019

    @LucaFilipozzi
    ContributorAuthor
  3. SteveL-MSFT commented on Dec 25, 2019

    @SteveL-MSFT
    Member

    Do you want to submit a PR for this one as well?

  4. LucaFilipozzi commented on Dec 25, 2019

    @LucaFilipozzi
    ContributorAuthor

    I have addressed this issue in pull request #11518.

  5. added
    WG-Remoting
    on Dec 25, 2019
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

    Issue-EnhancementWG-Remoting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions