PowerShell / PowerShell/Win32-OpenSSH

"SSH-2.0-OpenSSH_for_Windows_9.5' is not recognized as an internal or external command, operable program or batch file.

Open
#2,252 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-sshd 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

I updated openssh installations on a machine running sshd through winget because they were quite dated. Unfortunately, I could only find the beta releases. When connecting to the machine it gives out the following error "'SSH-2.0-OpenSSH_for_Windows_9.5' is not recognized as an internal or external command, operable program or batch file."

To work around the issue on the server, I've just copied over the sshd executable and renamed it 'SSH-2.0-OpenSSH_for_Windows_9.5'. This supringsinly works well, but when connecting from other clients like the one bundled with git setup it'll complain about other variants of executables missing e.g. "'SSH-2.0-OpenSSH_9.7' is not recognized as an internal or external command, operable program or batch file."

On surface, it seems that when connecting to sshd, the ssh version the user uses relays some information about client version used and the sshd(eamon) uses that to fork the process.

Expected behavior
ssh connects without disconnecting due to missing executable based on client versiion
Actual behavior
> ssh server@ipv6address

debug1: channel 0: new session [client-session] (inactive timeout: 0)
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching C:\\Users\\phpfr/.ssh/known_hosts for [127.0.0.1]:2222 / (none)
debug1: client_input_hostkeys: searching C:\\Users\\phpfr/.ssh/known_hosts2 for [127.0.0.1]:2222 / (none)
debug1: client_input_hostkeys: hostkeys file C:\\Users\\phpfr/.ssh/known_hosts2 does not exist
debug1: client_input_hostkeys: host key found matching a different name/address, skipping UserKnownHostsFile update
debug1: pledge: fork
'SSH-2.0-OpenSSH_for_Windows_9.5' is not recognized as an internal or external command,
operable program or batch file.
debug1: channel 0: free: client-session, nchannels 1
Connection to 127.0.0.1 closed by remote host.
Transferred: sent 3236, received 3260 bytes, in 34.3 seconds
Bytes per second: sent 94.2, received 94.9
debug1: Exit status -1

PS > ssh server@ipv6address

debug1: channel 0: new session [client-session] (inactive timeout: 0)
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching C:\\Users\\phpfr/.ssh/known_hosts for [127.0.0.1]:2222 / (none)
debug1: client_input_hostkeys: searching C:\\Users\\phpfr/.ssh/known_hosts2 for [127.0.0.1]:2222 / (none)
debug1: client_input_hostkeys: hostkeys file C:\\Users\\phpfr/.ssh/known_hosts2 does not exist
debug1: client_input_hostkeys: host key found matching a different name/address, skipping UserKnownHostsFile update
debug1: pledge: fork
'SSH-2.0-OpenSSH_9.7' is not recognized as an internal or external command,
operable program or batch file.
debug1: channel 0: free: client-session, nchannels 1
Connection to 127.0.0.1 closed by remote host.
Transferred: sent 3236, received 3260 bytes, in 34.3 seconds
Bytes per second: sent 94.2, received 94.9
debug1: Exit status -1
Error details
n/a
Environment data
n/a
Version

This problem seems to happen for both ssh bundled in git, and the one installed from this repository.

SSH-2.0-OpenSSH_for_Windows_9.5 <--> SSH-2.0-OpenSSH_for_Windows_9.5
SSH-2.0-OpenSSH_9.7 <--> SSH-2.0-OpenSSH_for_Windows_9.5

Visuals

n/a

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

Reproduce the Windows sshd connection using the listed OpenSSH client and server versions, then inspect the server-side behavior after the logged “pledge: fork” step. Trace why the client version string is treated as an executable name; done means clients connect without the missing-command error or remote disconnect.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking, operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.