ssh authorized_keys rsync problem

Jason Keltz jas at
Wed Apr 15 16:23:56 GMT 2009

I am trying to pull some data from an rsync server to a client using 
ssh, authorized_keys, and a hard-coded "command=" on the server.  I've 
been trying to figure it out on my own, but I know I'm missing a detail.

I can ssh from the client to the server without a password no problem.

I'm a bit confused as to what the authorized_keys file should contain on 
the server (aside from the key of course).  I have this:

command="rsync-3.0.4 --daemon --log-file=/var/log/rsynclog 

  ssh-rsa <the key>

The /etc/rsyncd.conf only contains:

path = /tmp/test

The problem is that when I try to do something like:

client # rsync -av --rsh=ssh server::test/ /tmp/test

... I get back:

rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(453) 

and on the server in /var/log/rsynclog I have:

2009/04/15 10:48:09 [13437] rsyncd version 3.0.4 starting, listening on 
port 873

Of course this isn't right because when the client disconnects, the 
rsync server is still running on port 873 on the server.

I've tried running without --daemon, but then it says that I'm using 
daemon options.

I want to be able to connect up with ssh, but still use the "daemon" 
mode where I can hard-code the only paths that the client can access 
(eventually, read only).


More information about the rsync mailing list