connection unexpectedly closed... solved

Nigel Gilbert n.gilbert at soc.surrey.ac.uk
Thu Jan 13 20:17:42 GMT 2005


Interestingly, when I use ssh to execute a non-existent command on the 
remote machine, no error message is returned (BTW, it is not clear in 
your email below whether you mean by "Your shell" the shell on the 
local machine - which certainly will complain if asked to execute a 
non-existent command - or the shell on the remote machine, which it 
appears does not).

I append a log of, in succession, executing the non-existent command  
'missing-rsync' on the remote machine, and then the versions of ssh on 
the local and remote machines (the local machine is SuSE Linux with 
bash, and the remote machine is Solaris 2.9, with the remote shell 
being sh):

socnt01:~ # ssh root at sandi missing-rsync                         
<====== no indication of error returned
socnt01:~ # ssh -v
OpenSSH_3.9p1, OpenSSL 0.9.7d 17 Mar 2004
usage: ssh [-1246AaCfghkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]
            [-D port] [-e escape_char] [-F configfile] [-i identity_file]
            [-L port:host:hostport] [-l login_name] [-m mac_spec] [-o 
option]
            [-p port] [-R port:host:hostport] [-S ctl] [user@]hostname 
[command]
socnt01:~ # ssh root at sandi ssh -v
SSH Version Sun_SSH_1.0, protocol versions 1.5/2.0.
Usage: ssh [options] host [command]
Options:
   -l user     Log in using this user name.
   -n          Redirect input from /dev/null.
   -A          Enable authentication agent forwarding.
   -a          Disable authentication agent forwarding.
   -X          Enable X11 connection forwarding.
   -x          Disable X11 connection forwarding.
   -i file     Identity for RSA authentication(default: ~/.ssh/identity).
   -t          Allocate a tty even if a command is given.
   -T          Do not allocate a tty.
   -v          Verbose; display verbose debugging messages.
               Multiple -v increases verbosity.
   -V          Display version number only.
   -P          Don't allocate a privileged port.
   -q          Quiet: don't display warning messages.
   -f          Fork into background after authentication.
   -e char     Set escape character; ``none'' = disable(default: ~).
   -c cipher   Select encryption algorithm: ``3des'', ``blowfish''
   -m macs     Specify MAC algorithms for protocol version 2.
   -p port     Connect to this port.  Server must be on the same port.
   -L listen-port:host:port   Forward local port to remote address
   -R listen-port:host:port   Forward remote port to local address
               These cause ssh to listen for connections on a port, and
               forward them to the other side by connecting to host:port.
   -C          Enable compression.
   -N          Do not execute a shell or command.
   -g          Allow remote hosts to connect to forwarded ports.
   -4          Use IPv4 only.
   -6          Use IPv6 only.
   -2          Force protocol version 2.
   -o 'option' Process the option as if it was read from a configuration 
file.
   -s           Invoke command (mandatory) as SSHv2 subsystem.
socnt01:~ #


On 13 Jan 2005, at 18:42, Wayne Davison wrote:

> On Thu, Jan 13, 2005 at 05:20:51PM +0000, Nigel Gilbert wrote:
>> This might be thought to be a bug or a missing feature in rsync; rsync
>> could have produced a more comprehensible error message.
>
> Your shell should have told you about the command problem -- for
> instance, I see this trying to run the command "missing-rsync":
>
>     zsh: no such file or directory: missing-rsync
>
> or this:
>
>     /bin/bash: missing-rsync: command not found
>
> This error should have been right in front of the error that rsync
> outputs.
>
> It might be possible for the local rsync to look for an abnormal exit
> code from ssh (I'll look at that), but the local rsync mainly just sees
> that its pipe is gone, and complains about that.
>
> ..wayne..
>
>



More information about the rsync mailing list