PowerShell / PowerShell/Win32-OpenSSH

invalid format err for ed25519 key, need to add a newline at the end of the key make to win ssh work with it

Open
#2,239 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-ssh Issue-Bug Known-workaround
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce

PS C:\Users\jy> C:\Users\jy\scoop\apps\openssh\current\ssh -V
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

PS C:\Users\jy> C:\Users\jy\scoop\apps\openssh\current\ssh -i ./gcp-ed25519 abc@35.xxx.yyy.140
Load key "./gcp-ed25519": invalid format
abc@35.xxx.yyy.140: Permission denied (publickey).

I can connect to server with this key file in wsl ssh and xshell 7, but not windows ssh

add a newline at the end of the key make win ssh accept this file, but why? (see also: https://stackoverflow.com/a/68593742)

Expected behavior
connect success
Actual behavior
PS C:\Users\jy> C:\Users\jy\scoop\apps\openssh\current\ssh  -i ./gcp-ed25519 abc@35.xxx.yyy.140
Load key "./gcp-ed25519": invalid format
abc@35.xxx.yyy.140: Permission denied (publickey).
Error details
None
Environment data
PS C:\Users\jy> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

9.5

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows OpenSSH 9.5 command with the ./gcp-ed25519 key, comparing the file with and without a final newline. Investigate why Windows ssh rejects the otherwise usable key and confirm the expected behavior against WSL ssh and Xshell. Done means the key is accepted by Windows ssh without manual newline editing, with the behavior covered by an appropriate project test.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
authentication, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.