Dhanasekaran Anbalagan <
[email protected]> writes:
Currently, we are connecting windows machines via OpenSSH.
When we execute the remote command it always returns exits status 0
console output for ref.
=====================
[rd@dvserver143 dhana]$ ssh [email protected] 'hostname'
WIN-7U3C8GAPDJI
[rd@dvserver143 dhana]$ echo $?
0
[rd@dvserver143 dhana]$ ssh [email protected] 'hostname1'
/bin/sh: hostname1: command not found
[rd@dvserver143 dhana]$ echo $?
0
[rd@dvserver143 dhana]$
=====================
please guide me. How to fix this.
How are you running OpenSSH on Windows? You clearly have some UNIX-like
layer on top of Windows, given the reference to "/bin/sh" in the error
message -- but which one?
For example, "eddie" is my Windows 10 laptop, with sshd running under
64-bit Cygwin. I'm invoking ssh from my Ubuntu system.
$ ssh eddie true ; echo $?
0
$ ssh eddie false ; echo $?
1
$ ssh eddie nosuchcommand ; echo $?
bash: nosuchcommand: command not found
127
$
(The reference to "bash" is probably because that's my login shell on
eddie.)
--
Keith Thompson (The_Other_Keith)
[email protected] <
http://www.ghoti.net/~kst> Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)