don't needlessly pass -l login_name or -p port to ssh (PowerShell…#11518
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…#11518Conversation
PaulHigin
left a comment
There was a problem hiding this comment.
LGTM
Thanks for fixing this.
|
What's the next step required in merging this pull request? I see that @PaulHigin has approved (thanks!) but that doesn't qualify as an approving review? IOW: is there anything else you need from me? |
|
@PoshChan Please retry all |
|
@PaulHigin, successfully started retry of |
|
@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. |
|
@LucaFilipozzi Thank you for your contribution! |
|
🎉 Handy links: |
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.