don't needlessly pass -l <username> or -p <port> to ssh#11431
Closed
LucaFilipozzi wants to merge 7 commits intoPowerShell:masterfrom
LucaFilipozzi:master
Closed
don't needlessly pass -l <username> or -p <port> to ssh#11431LucaFilipozzi wants to merge 7 commits intoPowerShell:masterfrom LucaFilipozzi:master
-l <username> or -p <port> to ssh#11431LucaFilipozzi wants to merge 7 commits intoPowerShell:masterfrom
LucaFilipozzi:master
Conversation
-l login_name to ssh unless -UserName is passed to cmdlets-l <username> to ssh unless -UserName <username> is passed to cmdlets
-l <username> to ssh unless -UserName <username> is passed to cmdlets-l <username> to ssh unless -UserName <username> is passed to *PSSession cmdlets
SteveL-MSFT
requested changes
Dec 25, 2019
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Outdated
Show resolved
Hide resolved
-l <username> to ssh unless -UserName <username> is passed to *PSSession cmdlets-l <username> or -p <port> to ssh unless -UserName <username> or -Port <port> are passed to *PSSession cmdlets
-l <username> or -p <port> to ssh unless -UserName <username> or -Port <port> are passed to *PSSession cmdlets-l <username> or -p <port> to ssh
LucaFilipozzi
commented
Dec 25, 2019
Contributor
Author
LucaFilipozzi
left a comment
There was a problem hiding this comment.
I have actioned the requested changes in #11432.
Contributor
Author
|
Let me know if you need me to make any additional changes. I believe that I've addressed the requested changes. |
Member
|
@PaulHigin Can you review? |
SteveL-MSFT
requested changes
Jan 7, 2020
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Outdated
Show resolved
Hide resolved
PaulHigin
suggested changes
Jan 7, 2020
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
Outdated
Show resolved
Hide resolved
Update local repository from origin.
Revert "Update local repository from origin."
Contributor
Author
|
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. |
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 <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 theUserandPortdirectives in ssh_config should they have been provided by the system administrator.This pull request should be non-breaking.