PowerShell / PowerShell/Win32-OpenSSH
UserKnownHostsFile parameter problems specifying paths with W
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 8.3k
- Forks
- 819
- PR merge metrics
- No merged PRs in 30d
Description
Only this weird construct works:
ssh -v -o'UserKnownHostsFile="""C:\Program Files\whitespace test\known_hosts"""' -i 'C:\Program Files\whitespace test\id_ecdsa' user@ip
Nothing else worked for me so far when specifying a path with whitespaces via PowerShell.
The -i parameter on the other side is capable of processing paths with a whitespace.
More badly, when executing the above command that works in PowerShell within a PowerShell module, we get:
command-line: line 0: Bad configuration option: 'userknownhostsfile
So executing an SSH command that contains a user known hosts path with whitespace within a PS module does not work at all.
Observed on:
Windows PowerShell 5.1 (Build 19041, Revision 906)
Windows 10 Enterprise
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 (FileVersion: 7.7.2.1)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported commands in Windows PowerShell 5.1, comparing UserKnownHostsFile and -i when paths contain spaces. Check the command-line parsing for the -o option and PowerShell module execution; done means a whitespace-containing known-hosts path works in both contexts without a bad configuration option error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100