Although not an rsync expert, I think your problem is in the way you reference the remote machine. rsync will either work on a remote machine gaining access via a shell (which SSH recently became the default) or will use the rsync daemon. Firstly, your configuration steps so far have setup an rsync daemon so you should have specified the syntax to connect to the daemon. This is achieve with a double colon "::" as opposed to the normal single colon. Secondly, if you use the the rsync demon you must refer to a "module" which in your case is "tmp" which just happens to be the same as the directory name. The syntax for referring to a module does not include a leading slash. So I suggest you try the following - just 1 character different: rsync -vz \ --password-file=/export/home/raub/nogo \ /export/home/raub/sync-me \ raub@katri::tmp At 16:18 16/02/2004, Mauricio Tavares wrote:> Easy rsync question: to try to learn a bit of rsync, I am setting >up katri (netbsd box) as my rsync server (where I would sync to) and >kushana (Solaris 9 box) as the machine I will be syncing from. BTW, both >are in my LAN and their respective /etc/hosts know their names, with or >withoug the domain part. So, in katri, I have: > >katri# cat /etc/rsyncd.conf >motd file = /etc/motd >max connections = 25 >syslog facility = local3 > >[tmp] > comment = temporary file area > path = /tmp > read only = no > list = yes > hosts allow = kushana > auth users = raub > secrets file = /etc/rsyncd.secrets > > >katri# cat /etc/rsyncd.secrets >raub:pogoland >katri# > ><The password here is just something to get me going; I can change it to >something better down the line =) > > >I also added rsync to /etc/services and /etc/inetd.conf: > >katri# grep rsync /etc/services >rsync 873/tcp # Rsync server >katri# grep rsync /etc/inetd.conf >rsync stream tcp nowait root /usr/local/bin/rsync >rsyncd >--daemon >katri# > >But, just to be paranoid, I decided to run it manually in server mode: > >katri# ps aux | grep rsync >root 8610 4.8 1.5 372 616 ?? Ss 11:00AM 0:00.42 rsync --daemon >root 8612 0.0 0.6 128 232 p0 R+ 11:00AM 0:00.17 grep rsync >katri# > >In kushana, I created a password file, nogo: > >raub@kushana-30>cat /export/home/raub/nogo >pogoland >raub@kushana-31> > >and am going to try to move the file /export/home/raub/sync-me to >katri:/tmp. >This is what I did and what I got back: > >raub@kushana-29>rsync -vz --password-file=/export/home/raub/nogo >/export/home/raub/sync-me raub@katri:/tmp >katri.kushana.com: Connection refused >rsync: connection unexpectedly closed (0 bytes read so far) >rsync error: error in rsync protocol data stream (code 12) at io.c(165) >raub@kushana-30> > >What I am doing wrong here? > >-- >To unsubscribe or change options: >http://lists.samba.org/mailman/listinfo/rsync >Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
At 21:01 +0000 2/16/04, Andrew Liles wrote:>Although not an rsync expert, I think your problem is in the way you >reference the remote machine. > >rsync will either work on a remote machine gaining access via a >shell (which SSH recently became the default) or will use the rsync >daemon. > >Firstly, your configuration steps so far have setup an rsync daemon >so you should have specified the syntax to connect to the daemon. >This is achieve with a double colon "::" as opposed to the normal >single colon. > >Secondly, if you use the the rsync demon you must refer to a >"module" which in your case is "tmp" which just happens to be the >same as the directory name. The syntax for referring to a module >does not include a leading slash. > >So I suggest you try the following - just 1 character different: > >rsync -vz \ > --password-file=/export/home/raub/nogo \ > /export/home/raub/sync-me \ > raub@katri::tmpHello there! Thanks for the info on the missing character; at least now I seem to be *almost* there: raub@kushana-13>rsync -vz \ ? --password-file=/export/home/raub/nogo \ ? /export/home/raub/sync-me \ ? raub@katri::tmp NetBSD 1.6.1 (GENERIC) #0: Tue Apr 8 21:00:42 UTC 2003 Welcome to NetBSD! @ERROR: auth failed on module tmp rsync: connection unexpectedly closed (164 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at io.c(165) raub@kushana-14> I still feel clueless. Would you have another pointer for what I should try next? Thanks!
check /var/log/messages check you have the correct file permissions on the daemon secrets file and local secret file; both should not be world readable At 03:33 17/02/2004, Mauricio wrote:>At 21:01 +0000 2/16/04, Andrew Liles wrote: >>Although not an rsync expert, I think your problem is in the way you >>reference the remote machine. >> >>rsync will either work on a remote machine gaining access via a shell >>(which SSH recently became the default) or will use the rsync daemon. >> >>Firstly, your configuration steps so far have setup an rsync daemon so >>you should have specified the syntax to connect to the daemon. This is >>achieve with a double colon "::" as opposed to the normal single colon. >> >>Secondly, if you use the the rsync demon you must refer to a "module" >>which in your case is "tmp" which just happens to be the same as the >>directory name. The syntax for referring to a module does not include a >>leading slash. >> >>So I suggest you try the following - just 1 character different: >> >>rsync -vz \ >> --password-file=/export/home/raub/nogo \ >> /export/home/raub/sync-me \ >> raub@katri::tmp > > Hello there! > > Thanks for the info on the missing character; at least now I seem > to be *almost* there: > >raub@kushana-13>rsync -vz \ >? --password-file=/export/home/raub/nogo \ >? /export/home/raub/sync-me \ >? raub@katri::tmp >NetBSD 1.6.1 (GENERIC) #0: Tue Apr 8 21:00:42 UTC 2003 > >Welcome to NetBSD! > > >@ERROR: auth failed on module tmp >rsync: connection unexpectedly closed (164 bytes read so far) >rsync error: error in rsync protocol data stream (code 12) at io.c(165) >raub@kushana-14> > >I still feel clueless. Would you have another pointer for what I should >try next? Thanks! >-- >To unsubscribe or change options: >http://lists.samba.org/mailman/listinfo/rsync >Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
At 05:26 +0000 2/17/04, Andrew Liles wrote:>check /var/log/messagesAll it has is stuff related to my Win2K machine (argh!): Feb 17 05:39:23 katri dhcpd: DHCPINFORM from 10.0.0.4 via le0 Feb 17 05:39:23 katri dhcpd: DHCPACK to 10.0.0.4>check you have the correct file permissions on the daemon secrets >file and local secret file; both should not be world readableThat was it! katri# ls -l /etc/rsyncd.* -rw-r--r-- 1 root wheel 250 Feb 16 10:50 /etc/rsyncd.conf -rw-r--r-- 1 root wheel 14 Feb 16 10:50 /etc/rsyncd.secrets katri# chmod go-r /etc/rsyncd.secrets katri# ls -l /etc/rsyncd.* -rw-r--r-- 1 root wheel 250 Feb 16 10:50 /etc/rsyncd.conf -rw------- 1 root wheel 14 Feb 16 10:50 /etc/rsyncd.secrets katri# the daemon secrets file was world readable. Once that was corrected, I had no problem moving the file around: <local machine. And, yes, the file I am moving around *is* the script I wrote to move it around =) > raub@kushana-3>./sync-me NetBSD 1.6.1 (GENERIC) #0: Tue Apr 8 21:00:42 UTC 2003 Welcome to NetBSD! nogo wrote 141 bytes read 174 bytes 90.00 bytes/sec total size is 9 speedup is 0.30 raub@kushana-4> <server machine> katri# ls -l /tmp/ total 1 -rw------- 1 nobody wheel 9 Feb 17 05:43 nogo katri# Thanks! Now, in my next installment is to see if I can keep/set the owner anyway I feel doign so. =)
Here's another easy rsync question (I am trying to make sense of some stuff): Let's say I have this burp file, which I set the follow uid/gid: raub@kushana-13>ls -l burp -rw-r--r-- 1 nobody4 noaccess 44800 Feb 18 13:07 burp raub@kushana-14> When I move it to katri, since it does not have those uid/gid defined, it just spits them out as the appropriate numbers (that were used when I created the file in kushana): katri# ls -l /tmp/ total 45 -rw-r--r-- 1 65534 60002 44800 Feb 18 13:07 burp -rwxr-xr-x 1 raub weirdos 508 Feb 17 10:42 sync-me* katri# Now, if I move burp back to kushana, I should see burps' gid and uid to be noaccess and nobody4, respectively, right? A not-so-easy rsync question: if I want to run it over ssh, what about the password for ssh? Do I need one? In the examples I saw in, say, http://hacks.oreilly.com/pub/h/38, there was not even a mention for the ssh user; do I have to worry about that? Save message
On Wed, Feb 18, 2004 at 02:54:58PM -0500, Mauricio Tavares wrote:> Now, if I move burp back to kushana [from katri], I should see burps' > gid and uid to be noaccess and nobody4, respectively, right?Typically, yes, but it does depend on the reverse name-mapping. As long as katri doesn't have its own name for those numerically-transferred IDs OR as long as the name(s) that katri just happened to put on those ID numbers do not match some different name on kushana, the reverse transfer will just keep the numeric IDs as well. It might be safer to force this with the --numeric-ids option, though, but that depends on how much other name-mapping you need. The best alternative is to ensure that both machines have all the names they need in common for the transfer, but that is not always possible. An example will make this clearer: Assume that kushana has gid 500=foo and gid 501=bar while katri has only 500=bar. If you transfer a file that is group "foo" from kushana to katri, it will get transferred with a numeric ID of 500 because katri does not have group "foo". However, on the reverse transfer, the group will be mapped as bar(500) back to bar(501), changing the group from what it was.> A not-so-easy rsync question: if I want to run it over ssh, what > about the password for ssh?That's entirely between you and ssh. There are host-authentication strategies as well as authorized-key strategies for avoiding password prompts (see the ssh-keygen manpage for details of the latter). Get ssh working as you would like it to first, then you can just use it with rsync. ..wayne..