howto enable ssh on connect to rsync daemon

Jim Salter jsalter at jrssystems.net
Thu Oct 9 17:46:38 EST 2003


> rsync -av --delete node2::resource /path/to/localresource > $LOG 2>&1
>
> [skipped text]
>
> Can someone please help how to set this up to go over SSH and without the
> need to supply a password?

You need to read the man page, specifically the sections on how to address
remote resources.  You don't have to (and shouldn't) attempt to set up rsync
shares if you're using SSH; that's only for operating in daemon mode.  You
want something more along the lines of the following:

rsync -rvz --rsh=/usr/local/bin/ssh username at servername:/path/to/resource
/path/to/resource

Hope that helps.

Jim Salter
JRS Systems

----- Original Message -----
From: " wilma " <wilma2002 at spray.se>
To: <rsync at lists.samba.org>
Sent: Thursday, October 09, 2003 3:49 AM
Subject: howto enable ssh on connect to rsync daemon


Hi,
I'm trying to setup automatic sync of files over SSH from node2 to node1.
node2 is the "server" and node1 is the "client".
I have setup rsync like this on the nodes which runs AIX (4.3.3 and 5.1):

1. Installed rsync from Linux Toolbox (rsync-2.5.4-1.aix4.3.ppc.rpm) on both
nodes.
2. Added following to both nodes /etc/services file:
     rsync           873/tcp
3. Added following to node2 /etc/inetd.conf and refreshed inetd
     rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon
4. Created /etc/rsyncd.conf on node2 with this content:
     log file = /var/log/rsyncd.log

     [resource]
             path = /path/to/resource
             comment = resource file area
             read only = yes
             auth users = user
             hosts allow = node1
             secrets file = /etc/rsyncd.secrets
5. Created /etc/rsyncd.secrets at mode 600 on node2 with this content:
user:password
6. Created a script on node1 to be used from cron with this content:
     #!/bin/ksh
     #
     LOG=/var/log/rsync.log
     export USER=user
     export RSYNC_RSH=ssh
     export RSYNC_PASSWORD=password

     echo $(date) >> $LOG
     echo "" >> $LOG

     rsync -av --delete node2::resource /path/to/localresource > $LOG 2>&1
     echo "**********************************************" >> $LOG

----------------------------------------------------------------------------
----------------------------
The script runs fine, but I can see in an iptrace it does'nt use SSH.
Instead it connects to port 873 on
node2.
I have tried adding the flag --rsh "ssh" to the command but it tells me
this:
"WARNING: --rsh or -e option ignored when connecting to rsync daemon"

Can someone please help how to set this up to go over SSH and without the
need to supply a password?
Thanks in advance
-wilma-

____________________________________________________________
  Singelkryssen lättar ankar igen! Ta med kompisarna!
  http://www.spray.se/datekryss




----------------------------------------------------------------------------
----


> --
> To unsubscribe or change options:
http://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html




More information about the rsync mailing list