Rsync and SSH on Windows

Lewis Franklin hcslmf at
Tue Feb 1 16:22:42 GMT 2005

I am writing a program that synchronizes my companies Windows laptops 
with our home server. Due to the nature of our proxy/firewall, I must 
use SSH with port forwarding to achieve this goal. Currently I establish 
the SSH connection using the following command:
    ssh ssh_user at -i file_name -L 873: -N
and then run rsync with the following command:
    rsync -azv rsync_user at .

This works well as two separate processes. However, having read the 
documentation it seems that I should be able to run the ssh commands 
"inline" using the -e flag. However, I have not been able to 
successfully sync using this method. I have tried using both OpenSSH for 
Windows and Plink from Putty. Here is the verbose output from each. 
Please note the file has been scrubbed for any information related to my 
company :)

rsync -azve "ssh -l ssh_user -i ssh_key 
873:" rsync_user at .
    OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
    debug1: Connecting to[IP] port 22.
    debug1: Connection established.
    debug1: identity file ssh_key type -1
    debug1: Remote protocol version 2.0, remote software version 
SSH Secure Shell (non-commercial)
    debug1: no match: SSH Secure Shell (non-commercial)
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: sending SSH2_MSG_KEXDH_INIT
    debug1: expecting SSH2_MSG_KEXDH_REPLY
    debug1: Host is known and matches the DSA host key.
    debug1: Found key
    debug1: ssh_dss_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,password
    debug1: Next authentication method: publickey
    debug1: Trying private key: ssh_key
    debug1: read PEM private key done: type DSA
    debug1: Authentication succeeded (publickey).
    debug1: Connections to local port 873 forwarded to remote address
    debug1: Local forwarding listening on port 873.
    debug1: channel 0: new [port listener]
    debug1: channel 1: new [client-session]
    debug1: Entering interactive session.
    debug1: Sending command: rsync --server --daemon . not found
    debug1: client_input_channel_req: channel 1 rtype exit-status reply 0
    debug1: channel 1: free: client-session, nchannels 2
    debug1: channel 0: free: port listener, nchannels 1
    debug1: fd 1 clearing O_NONBLOCK
    debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.1 seconds
    debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
    debug1: Exit status 127 not found
    rsync: read error: Connection reset by peer
    rsync error: error in rsync protocol data stream (code 12) at 

rsync -azve "plink -l ssh_user -i ssh_key -L 
873: -v" rsync_user at .
    Server version: SSH-2.0- SSH Secure Shell (non-commercial)
    We believe remote version has SSH1 ignore bug
    We claim version: SSH-2.0-PuTTY-Release-0.56
    Using SSH protocol version 2
    Doing Diffie-Hellman key exchange
    Host key fingerprint is:
    ssh-dss 2048 9a:fc:d2:9d:10:ff:65:4f:df:85:e1:05:40:2a:55:20
    Initialised AES-256 client->server encryption
    Initialised AES-256 server->client encryption
    Initialised HMAC-SHA1 client->server MAC algorithm
    Initialised HMAC-SHA1 server->client MAC algorithm
    Using username "ssh_user".
    Reading private key file
    Offered public key
    Offer of public key accepted
    Authenticating with public key "imported-openssh-key"
    Access granted
    Opened channel for session
    Local port 873 forwarding to
    Started a shell/command
    Sent EOF message not found
    Server sent command exit status 127
    All channels closed. Disconnecting
    rsync: read error: Connection reset by peer
    rsync error: error in rsync protocol data stream (code 12) at 

The output may be a bit excessive, but I wanted to err on the side of 
too much information. I hope that there is a solution available and 
thank you in advance to any of you who look into this for me.

Lewis Franklin
Senior Computing Services Associate
Texas Life Insurance

More information about the rsync mailing list