Skip to content

Conversation

@LucaFilipozzi
Copy link
Contributor

@LucaFilipozzi LucaFilipozzi commented Dec 24, 2019

PR Summary

Fix #11344 by not passing -l <username> to ssh unless -UserName <username> is passed to *PSSession cmdlets.

Fix #11432 by not passing -p <port> to ssh unless -Port <port> is passed to *PSSession cmdlets.

PR Context

When invoking *PSSession cmdlets, PowerShell's StartSSHProcess function passes a -l <username> command line argument to the underlying operating system's ssh client even when -UserName <username> is not passed to the cmdlets.

Similarly, StartSSHProcess passes -p <port> to ssh even when -Port <port> is not passed to the cmdlets.

Neither is necessary since the ssh client will determine the username from the environment and defaults the port to 22.

More importantly, by always passing -l <username> and -p <port>, StartSSHProcess overrides the User and Port directives in ssh_config should they have been provided by the system administrator.

This pull request should be non-breaking.

@ghost ghost assigned TravisEz13 Dec 24, 2019
@msftclas
Copy link

msftclas commented Dec 24, 2019

CLA assistant check
All CLA requirements met.

@LucaFilipozzi LucaFilipozzi changed the title don't pass -l login_name to ssh unless -UserName is passed to cmdlets don't pass -l <username> to ssh unless -UserName <username> is passed to cmdlets Dec 24, 2019
@LucaFilipozzi LucaFilipozzi changed the title don't pass -l <username> to ssh unless -UserName <username> is passed to cmdlets don't pass -l <username> to ssh unless -UserName <username> is passed to *PSSession cmdlets Dec 24, 2019
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Dec 25, 2019
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Dec 25, 2019
@LucaFilipozzi LucaFilipozzi changed the title don't pass -l <username> to ssh unless -UserName <username> is passed to *PSSession cmdlets don't pass -l <username> or -p <port> to ssh unless -UserName <username> or -Port <port> are passed to *PSSession cmdlets Dec 25, 2019
@LucaFilipozzi LucaFilipozzi changed the title don't pass -l <username> or -p <port> to ssh unless -UserName <username> or -Port <port> are passed to *PSSession cmdlets don't needlessly pass -l <username> or -p <port> to ssh Dec 25, 2019
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Dec 25, 2019
@iSazonov iSazonov added this to the 7.1.0-preview.1 milestone Dec 25, 2019
Copy link
Contributor Author

@LucaFilipozzi LucaFilipozzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have actioned the requested changes in #11432.

@LucaFilipozzi
Copy link
Contributor Author

Let me know if you need me to make any additional changes. I believe that I've addressed the requested changes.

@TravisEz13
Copy link
Member

@PaulHigin Can you review?

@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Jan 7, 2020
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jan 7, 2020
Update local repository from origin.
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jan 8, 2020
@LucaFilipozzi
Copy link
Contributor Author

LucaFilipozzi commented Jan 8, 2020

Apologies for pulling in additional reviewers in my misguided attempt to bring LucaFIlipozzi/PowerShell up to date with PowerShell/PowerShell.

I'm going to close this Pull Request and create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

don't override Port in ssh_config don't override User in ssh_config

6 participants