My remote machine is a windows and I am doing ssh
from ubuntu to windows.
I want to use git bash instead of command prompt, but running the ssh
will bring me to the default command prompt, is there any way that I could invoke git bash through ssh
?
I try the following command not working:
ssh Administrator@54.xxx.xxx.207 < "C:\Program Files\Git\bin\sh.exe"
I can run the following command to after ssh to start the git bash, but I am seeking a way to automate this process?
"C:\Program Files\Git\bin\sh.exe" --login
I am using Windows 2012 R2
Best Answer
Yes, you can if you have OpenSSH For Windows Server 2019 and Windows 10 installed.
From OpenSSH Server Configuration for Windows 10 1809 and Server 2019:
To set Git Bash as default shell, run this snippet as administrator in the PowerShell:
To get a login shell, you could create a batch file
sh.bat
inC:\Program Files\Git\bin
with this content:and replace the
DefaultShell
value withC:\Program Files\Git\bin\sh.bat
.The
DefaultShell
registry key is a new key, you can delete it to restore the default command prompt.