-
Notifications
You must be signed in to change notification settings - Fork 8.1k
don't needlessly pass -l <username> or -p <port> to ssh
#11431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
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
There was a problem hiding this 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.
|
Let me know if you need me to make any additional changes. I believe that I've addressed the requested changes. |
|
@PaulHigin Can you review? |
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
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."
|
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. |
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.