[BALU] rsync: --password-file doesn't work

Daniel Hallmark daniel.hallmark at gmail.com
Thu Feb 8 00:03:53 CST 2007

More info:

Apparently all you need to do is configure /etc/rsyncd.conf and run
rsync (as root because it requires access to a restricted port < 1024)
with the --daemon argument to run it as a server.  There is no
separate rsyncd program.

In /etc/rsyncd.conf you need to set up a "module" which acts like a
named fileshare.  So for example I could set one up like:


And then to download the contents of the rsync_testdir I would run

rsync --recursive /Users/dgh

Note that I'm using a double colon after the hostname (that tells the
rsync client to connect to an rsync server rather than using ssh for
transport - and also note that DGH_HOME is the "module name" or
fileshare name I created in rsyncd.conf.  The path to be synced is
relative to that module/share.

If you don't provide an "auth users" line in the module config then it
allows a connection with a username/password.  The global portion of
the rsyncd.conf file specifies where the secrets file lives that
contains the username/password info if you do decide to lock down a
module to only allow access from specific user IDs.

Those IDs to not have to exist as system/shell accounts.  These are
separate "rsync" server user IDs.  When you were prompted for the
password in your previous (non-daemon) example I believe it was
actually ssh that was prompting you for a shell account password
before allowing rsync to run across the ssh tunnel.

You might also need to play around with some of the other global
rsyncd.conf parameters. See man rsyncd.conf.  Although I was able to
start rynscd there was some sort of issue with registering the rsync
process with slp - it looks like an old issue with reiserfs and slp
that I probably could address if I were sufficiently motived.  But at
present I wasn't able to have a completely successful test although
I'm pretty sure this will resolve your problem.


On 2/7/07, Daniel Hallmark <daniel.hallmark at gmail.com> wrote:
> Per the man page documentation:
>        --password-file
>               This option allows you to provide  a  password  in  a  file  for
>               accessing  a  remote rsync server. Note that this option is only
>               useful when accessing a rsync server using the built  in  trans-
>               port,  not  when using a remote shell as the transport. The file
>               must not be world readable. It should contain just the  password
>               as a single line.
> My guess is that your linux box is not actually running the rsync
> server on TCP port 873.  Instead you're simply trying to automate a
> manual rsync process via an SSH remote shell.  The --password-file
> option isn't used when you're running rsync across a shell.  To do
> what you're trying to do your linux box needs to be running rsyncd.
> I tested this between my iMac and my linux laptop and got the same
> results (prompted for a password) when not running rsyncd on the
> laptop.  I don't have rsyncd installed or I'd fire it up and give it a
> try, but I think that may solve your problem.
> Daniel
> On 2/7/07, Eric Volker <evolker at gmail.com> wrote:
> > I'm trying to automate rsync on a Mac OS X machine to sync some files
> > from a Linux file server. From a shell, I can type
> >
> > rsync <ip address>:/path/to/remote/folder /path/to/local/folder
> >
> > I can then enter the password, and then everything syncs up just
> > dandy. However, when I try to automate authentication by using the
> > following:
> >
> > rsync --password-file=/Users/<username>/rsync-pass <ip address>:/path/
> > to/remote/folder /path/to/local/folder
> >
> > I *still* get prompted for the freaking password. Per man rsync, the
> > only thing in the rsync-pass folder is the password as a single line.
> > What could I possibly be missing?
> >
> > Thanks,
> >
> > Eric Volker

More information about the Members mailing list