Title: SSH KeyFilePath parameter not working · Issue #4475 · PowerShell/PowerShell · GitHub
Open Graph Title: SSH KeyFilePath parameter not working · Issue #4475 · PowerShell/PowerShell
X Title: SSH KeyFilePath parameter not working · Issue #4475 · PowerShell/PowerShell
Description: 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 Ke...
Open Graph Description: 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-base...
X Description: 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-...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4475
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SSH KeyFilePath parameter not working ","articleBody":"When I try running New-PSSession or Enter-PSSession using a public key, powershell either:\r\n1. When passed a valid KeyFilePath, complains that it doesn't exist and continues gracefully to password-based authentication.\r\n2. When passed a bogus KeyFilePath, throws an ItemNotFoundException\r\n\r\nSteps to reproduce\r\n------------------\r\n```powershell\r\n\u003e New-PSSession -UserName \"xx\" -KeyFilePath \"/fakepath\" -Hostname \" xx.xx.xx.xx\"\r\nNew-PSSession : Cannot find path 'doesntexist' because it does not exist.\r\nAt line:1 char:1\r\n+ New-PSSession -UserName \"Administrator\" -KeyFilePath \"doesntexist\" -H ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (doesntexist:String) [New-PSSession], ItemNotFoundException\r\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewPSSessionCommand\r\n\r\n\u003e New-PSSession -UserName \"xx\" -KeyFilePath \"~/.ssh/id_rsa\" -Hostname \" xx.xx.xx.xx\"\r\nWarning: Identity file \"/Users/cquinonez/.ssh/workgangkey\" not accessible: No such file or directory.\r\n\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n```powershell\r\n\u003e New-PSSession -UserName \"xx\" -KeyFilePath \"/fakepath\" -Hostname \" xx.xx.xx.xx\"\r\nWarning: Identity file \"/Users/cquinonez/.ssh/workgangkey\" not accessible: No such file or directory.\r\n\u003e New-PSSession -UserName \"xx\" -KeyFilePath \"\u003cvalidKeyFilePath\u003e\" -Hostname \" xx.xx.xx.xx\"\r\n\r\n Id Name ComputerName ComputerType State ConfigurationName Availability\r\n -- ---- ------------ ------------ ----- ----------------- ------------\r\n 1 SSH1 xx.xx.xx.xx RemoteMachine Opened DefaultShell Available\r\n```\r\n\r\n\r\nActual behavior\r\n---------------\r\n\r\n\r\nI've verified that `Test-Path` also correctly detects the key file as well.\r\n\r\nEnvironment data\r\n----------------\r\n```powershell\r\n\u003e $PSVersionTable\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-beta\r\nPSEdition Core\r\nGitCommitId v6.0.0-beta.4\r\nOS Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/luzlab","@type":"Person","name":"luzlab"},"datePublished":"2017-08-03T04:25:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/4475/PowerShell/issues/4475"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:43a02acc-965d-0876-5d53-5878b644798e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D1C:ECF3D:759DE0:AB29F6:6A5753B2 |
| html-safe-nonce | 540c78a03b769388a5d37fc670aa18e23f6377af7251d9ceab5f16b4801d7de6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDFDOkVDRjNEOjc1OURFMDpBQjI5RjY6NkE1NzUzQjIiLCJ2aXNpdG9yX2lkIjoiNjg3OTUyNTc2NzIyMDc3NzkwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 465c6ce36ba6a454d12cb46bcd6470c5d7ee63431ea1e80575fea24f53b7ee4d |
| hovercard-subject-tag | issue:247588770 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/4475/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6c28e1b24a72268928616ce3c8d865cf189b5531824ece7ec7ccd557699016ae/PowerShell/PowerShell/issues/4475 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6c28e1b24a72268928616ce3c8d865cf189b5531824ece7ec7ccd557699016ae/PowerShell/PowerShell/issues/4475 |
| og:image:alt | 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-base... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | luzlab |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 602250ea3b6dd8302a7220ef98adb828dbc807e4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width