{{ message }}
don't needlessly pass -l login_name or -p port to ssh (PowerShell…#11518
Merged
adityapatwardhan merged 1 commit intoPowerShell:masterfrom Jan 29, 2020
LucaFilipozzi:master
Merged
don't needlessly pass -l login_name or -p port to ssh (PowerShell…#11518adityapatwardhan merged 1 commit intoPowerShell:masterfrom LucaFilipozzi:master
-l login_name or -p port to ssh (PowerShell…#11518adityapatwardhan merged 1 commit intoPowerShell:masterfrom
LucaFilipozzi:master
Conversation
PaulHigin
approved these changes
Jan 8, 2020
Contributor
PaulHigin
left a comment
There was a problem hiding this comment.
LGTM
Thanks for fixing this.
Contributor
Author
Contributor
|
@PoshChan Please retry all |
Collaborator
|
@PaulHigin, successfully started retry of |
Contributor
|
@LucaFilipozzi You don't need to do anything right now. It looks like help update tests all failed so I have restarted tests. The maintainer, @adityapatwardhan, still needs to approve and merge the changes. |
adityapatwardhan
approved these changes
Jan 29, 2020
Member
|
@LucaFilipozzi Thank you for your contribution! |
adityapatwardhan
pushed a commit
to adityapatwardhan/PowerShell
that referenced
this pull request
Feb 18, 2020
14 tasks
22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR Summary
Fix #11344 by not passing -l to ssh unless -UserName is passed to *PSSession cmdlets.
Fix #11432 by not passing -p to ssh unless -Port is passed to *PSSession cmdlets.
PR Context
When invoking *PSSession cmdlets, PowerShell's StartSSHProcess function passes a -l command line argument to the underlying operating system's ssh client even when -UserName is not passed to the cmdlets.
Similarly, StartSSHProcess passes -p to ssh even when -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 and -p , 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.
This pull request replaces #11431 which I messed up.