12

I have custom macros etc in my mobaxterm, but I have worked for a half a year on a remote linux machines, now I have my code on my local PC and I use git bash. Can I use it through MobaXterm?

3 Answers3

14

MobaXterm -> Settings -> Configuration -> Terminal -> Use Windows PATH environment -> check -> OK

If you should change the windows path later (for instance by installing software), you have to restart mobaxterm for the changes to take effect.

anneb
  • 1,294
0

Yes, you can use git in a local terminal of MobaXterm. However, you might run into terminal IO problems, depending on the git installation you use. If you install "Git for Windows (git-bash)" and you add(*) the directories containing the git binaries to your MobaXterm PATH, then basic local git operations work for sure.


(*) Add the git directories at the end of PATH, so the git-bash's bash does not interfere with the MobaXterm bash.

halloleo
  • 575
0

With the accepted answer, you are using MobaXTerm's "bash" shell rather than the "git-bash" shell. To use git-bash, you can set the default ssh shell of your own machine to git-bash, and then ssh into your own machine with Moba. Below is a quick setup for enabling windows ssh server, starting sshd, and setting your default shell to git-bash:

Requires Powershell and Windows 10+

PS C:\Windows\system32> Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
PS C:\Windows\system32> Start-Service sshd
PS C:\Windows\system32> New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\Git\bin\sh.exe" -PropertyType String -Force

Then start a new ssh session in MobaXTerm @localhost. The credentials are your windows login.

See here for the original idea: https://www.hanselman.com/blog/how-to-ssh-into-a-windows-10-machine-from-linux-or-windows-or-anywhere

See here for more windows ssh settings: https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration

chiliNUT
  • 1,253