Goal: Add MSYS2/MinGW64 BASH as an optional shell to an existing OpenSSH server with automation purposes in mind.
Constraints:
- Not Windows 10. WSL is not an option.
- Shared work environment. Shouldn't "pee in the other kids' pool" beyond what's avoidable.
- Keep PowerShell Core as primary SSH shell.
- Have MSYS2/MinGW64 available with minimal overhead as needed.
- Automation is key.
Setup:
Following instructions from various Microsoft sources:
- https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse
- https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core?view=powershell-6
I have successfully gotten PowerShell over SSH working. However, I have the (more-than-occasional) need to run the MSYS2/MinGW Bash shell.
What KINDA works:
running bash in ssh from the CLI: ssh dms3@somehost C:/MSYS64/usr/bin/bash.exe --login (No prompt, can't re-enable in PS1)
Setting the Bash exe as a subsystem: (same as above in best-cases, freezes in others) Subsystem bash c:/MSYS64/usr/bin/bash.exe --login
Both are possibly "good enough" for automation.
What would work, but I'd rather not do:
- Running MSYS sshd as a second SSH server on a different port.
- Running Bash after logging into Powershell
What I can't do
- Use a Linux VM.
- Use WSL.