It's not the same ssh
.
In Bash inside MobaXterm ssh
is aliased to /bin/ssh.exe
which is a shell script which eventually runs /bin/_ssh.exe
. These files were installed with MobaXterm. Outside MobaXterm they exist in %MyDocuments%\MobaXterm\slash\bin
.
Your command prompt uses some other ssh.exe
.
An IP address with only two dots is valid, still in practice some tools may disagree. And it's not the only possible cause to disagree, see this question about leading zeros.
To make both methods behave in the same way, you need to use the same ssh.exe
each time.
Always use ssh
from MobaXterm.
Note even if you add %MyDocuments%\MobaXterm\slash\bin
to your PATH
in Windows, you won't be able to use ssh.exe
from MobaXterm because it's not an executable Windows would understand. You can use _ssh.exe
though: copy it to another location, rename to ssh.exe
adjust PATH
in Windows. This ssh
will not support addresses like [email protected]
.
Or the other way around: always use the other ssh
.
The simplest approach seems to redefine the ssh
alias in Bash inside MobaXterm to point to ssh.exe
used by your command prompt.
alias ssh='/cygdrive/c/proper/path/ssh.exe'
But note the original /bin/ssh.exe
script is there for a reason. So maybe it's better to leave the original alias intact and to…
patch SSH_PROG="/bin/_ssh.exe"
in the script and point to /cygdrive/c/proper/path/ssh.exe
. The "new" ssh.exe
may not be fully compatible with the script though. Future updates (if any) may revert the changes.
Anyway in your case this ssh
should support addresses like [email protected]
.
Even if you use the same ssh.exe
but still rely on the script in one case, the results may not be strictly identical because the script does something extra.