You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try running New-PSSession or Enter-PSSession using a public key, powershell either:
When passed a valid KeyFilePath, complains that it doesn't exist and continues gracefully to password-based authentication.
When passed a bogus KeyFilePath, throws an ItemNotFoundException
Steps to reproduce
>New-PSSession-UserName "xx"-KeyFilePath "/fakepath"-Hostname " xx.xx.xx.xx"New-PSSession : Cannot find path 'doesntexist' because it does not exist.
At line:1 char:1+New-PSSession-UserName "Administrator"-KeyFilePath "doesntexist"-H ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (doesntexist:String) [New-PSSession], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewPSSessionCommand
>New-PSSession-UserName "xx"-KeyFilePath "~/.ssh/id_rsa"-Hostname " xx.xx.xx.xx"
Warning: Identity file "/Users/cquinonez/.ssh/workgangkey" not accessible: No such file or directory.
Expected behavior
>New-PSSession-UserName "xx"-KeyFilePath "/fakepath"-Hostname " xx.xx.xx.xx"
Warning: Identity file "/Users/cquinonez/.ssh/workgangkey" not accessible: No such file or directory.
>New-PSSession-UserName "xx"-KeyFilePath "<validKeyFilePath>"-Hostname " xx.xx.xx.xx"
Id Name ComputerName ComputerType State ConfigurationName Availability
----------------------------------------------------------------1 SSH1 xx.xx.xx.xx RemoteMachine Opened DefaultShell Available
Actual behavior
I've verified that Test-Path also correctly detects the key file as well.
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 6.0.0-beta
PSEdition Core
GitCommitId v6.0.0-beta.4
OS Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 1517:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
When I try running New-PSSession or Enter-PSSession using a public key, powershell either:
Steps to reproduce
Expected behavior
Actual behavior
I've verified that
Test-Pathalso correctly detects the key file as well.Environment data