18

The Powershell OpenSSH website has good instructions on how to install and use OpenSSH.

These include how to "Configuring the default ssh shell (optional)"

If I elect to use git-bash instead of powershell, what -Value do I put into the following other than "/c"

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShellCommandOption -Value "/c" -PropertyType String -Force

I get a blank screen when I set the default shell to be git-bash.
I tried "-c" and "-l -i" but neither one worked and I am still getting a blank screen.

Clay
  • 621

3 Answers3

21

This should be all you need:

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\Git\bin\bash.exe" -PropertyType String -Force
2

If you need to use the cygwin provided bash, this worked for me:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH] "DefaultShell"="C:\cygwin64\Cygwin.bat"

ceztko
  • 172
  • 1
  • 8
2

Create a file over "C:\Program Files\Git\cmd\git-bash.cmd" with:

@ECHO off

cmd /c "%ProgramFiles%\Git\bin\bash.exe" --login

then execute the following command on powershell

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\Git\cmd\git-bash.cmd" -PropertyType String -Force
Giovani
  • 21