PowerShell / PowerShell/Win32-OpenSSH

`command not found` when connecting to OpenSSH server using Git Bash as DefaultShell and disabling pseudo-terminal allocation

Open
#2,354 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Terminal Issue-Bug
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
  1. On machine running OpenSSH server, install Git Bash and set DefaultShell for OpenSSH Server to the path of Git Bash (on my machine, I used D:\Programs\Git\usr\bin\bash.exe).
  2. On another machine, connect to the OpenSSH server with ssh -T <host_address>.

I am attempting to use VS Code Remote-SSH to connect from my laptop to my desktop (running OpenSSH). This fails to connect. The underlying command being used is ssh -T <host_address>. I have configured OpenSSH to use DefaultShell to be Git Bash. Note: clearing this makes it work though now when I need to ssh into my desktop I need to manually run bash.

Expected behavior
> ssh -T <address>
echo hi<C-d>
hi
Actual behavior
> ssh -T <address>
/d/programs/git/usr/bin/bash: line 1: : command not found
/d/programs/git/usr/bin/bash: line 2: : command not found
/d/programs/git/usr/bin/bash: line 3: : command not found
/d/programs/git/usr/bin/bash: line 4: : command not found
/d/programs/git/usr/bin/bash: line 5: : command not found
/d/programs/git/usr/bin/bash: line 6: : command not found
/d/programs/git/usr/bin/bash: line 7: : command not found
/d/programs/git/usr/bin/bash: line 8: : command not found
/d/programs/git/usr/bin/bash: line 9: : command not found
/d/programs/git/usr/bin/bash: line 10: : command not found
/d/programs/git/usr/bin/bash: line 11: : command not found
/d/programs/git/usr/bin/bash: line 12: : command not found
/d/programs/git/usr/bin/bash: line 13: : command not found
Error details

Environment data
I am not running Powershell
Version

9.5.4.1

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

Reproduce the setup with Windows OpenSSH, Git Bash as DefaultShell, and ssh -T, then compare it with a connection that uses a pseudo-terminal or the default shell. Trace how the server handles non-interactive input and confirm that the expected echo hi output is produced without repeated command not found messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, git
Domain
cli, networking
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.