Koozali.org: home of the SME Server

Dungog Rsync Help

Anonymous

Dungog Rsync Help
« on: July 16, 2004, 01:04:35 AM »
Trying to back up one ibay to another (on a second, internal server).  Getting error:
push_dir .: Permission denied (3)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(317)
rsync: connection unexpectedly closed (28 bytes reEnding rsync transfer.
 error in rsync protocol data stream (code 12) at io.c(151)


Trying to copy from one 'test' ibay to another. permissions are set to allow all access, and are marked as 'ok' in the rsync panel.

What am I doing wrong?

malden7794

Also experiencing same problem
« Reply #1 on: July 22, 2004, 07:02:43 PM »
We are getting the same error. Just did a fresh install with the latest version on two boxes. they cannot rsync into each other.

We need to get a solution to back up two SME boxes to each other (ibays) and would be willing to pay someone that can remote in and fix this problem - or figure out a solution to this problem.

Anyone?

Offline stancol

  • ****
  • 90
  • +0/-0
    • http://www.srcproductions.com
Secure Connection Without Passwords
« Reply #2 on: July 26, 2004, 07:16:40 AM »
Taken from the Dungog.net SME Server Help Pages.

Quote
Note, the method you use here is independant of the rsync rpm, the rsync rpm will not work until you can slogin to the remote server without being prompted for a password or passphrase


Quote
Before you start using dungog-rsync


To establish a secure connection without being prompted for a password you need to install ssh authorized keys, select/create a user on both server with enough permission to read the files you want to transfer, you may need to make them a member of the group that owns the files or chown the files. Using root should work but is never recommended.
Give both users shell access, as the user, use the program ssh-keygen to create your encryption keys then copy the public key to the remote server
slogin to the remote server and add you public key to the file authorized_keys, logout of remote, now you should be able to slogin to the remote server from the local server without being prompted for your password.
The following commands should be all you need.

Note, the method you use here is independant of the rsync rpm, the rsync rpm will not work until you can slogin to the remote server without being prompted for a password or passphrase.

enable shell access to both servers for a common username
ssh to both servers, mkdir ~/.ssh
ssh to local.server.net, cd to ~/.ssh
ssh-keygen -t rsa [accept file name id_rsa][don't enter a passphrase]
scp id_rsa.pub remote.server.net:.ssh/local.pub
slogin remote.server.net
cd .ssh
cat local.pub >> authorized_keys


Untill you can log on to all of the other servers without a password you can't rsync to them. If you're rsyncing from Server A to Server B you need to be able to log into Server A and then (if you've done it right) log into Server B without it asking you for a password. If Server B (the server your sending files too) responds and asks you for a password you haven't done something correctly above.
What are the three dots for at the end of my signature file and why can't I get rid of them?These three dots right here >...

Offline psoren

  • *
  • 371
  • +0/-0
Dungog Rsync Help
« Reply #3 on: July 26, 2004, 10:17:55 AM »
HI

I found this easy howto.

øSetup the *nix Machines: (We will use rsync with the SSH option to backup these systems.)
Enable SSH access to the servers, in server-manager
We need to be able to SSH into these machines without being prompted for a password. Here is an excerpt from an email that explains this:

<EXCERPT>
Here's the technique in a nutshell (just tried it out on 3 esmith servers):Let's say that you're working on server 10.0.0.20 and you want to ssh to server 10.0.0.30 without having to use a password. On 10.0.0.20, issue the following command as root: # ssh-keygen -t rsa This will prompt you for a location to store the key (use the default) and for a passphrase (leave blank). Next, use scp (secure copy) to move the key to 10.0.0.30 # scp .ssh/id_rsa.pub 10.0.0.30:/root/.ssh/authorized_keys2 This will prompt you for the root password on 10.0.0.30 and will then transfer the key from 10.0.0.20 to 10.0.0.30. It should do the trick. Try it out by running an ssh session from the command line:# ssh 10.0.0.30 It should let you in without a password. You can scp the ".ssh/id_rsa.pub" file to other servers without having to create a public key for each. -MD

Per

Offline stancol

  • ****
  • 90
  • +0/-0
    • http://www.srcproductions.com
Basicly the Same
« Reply #4 on: July 27, 2004, 09:23:31 PM »
Basically (in concept) the post from PSOREN and my earlier post are the same. It's nice to have the same thing from two different views though. It took me weeks to get it right the first time.

You can do the same thing too with DSH. In place of "ssh-keygen -t rsa" type "ssh-keygen -t dsa" then where ever it says ...rsa change it to dsa. DSA is supposed to be more secure than RSA. Hope this helps more. If your still having trouble you might do a Google search for setting up public keys. Between what I read on Dungog's site and Google searches is how I got enough information to get it right.
What are the three dots for at the end of my signature file and why can't I get rid of them?These three dots right here >...

malden7794

thank you both for replying!
« Reply #5 on: July 27, 2004, 10:33:50 PM »
Question: isn't the idea of Anonymous rsync created so that keys don't have to be exchanged?  

Are you both using the Anonymous or the secure rsync when you connect?

I have been able to exchange the keys between my two test machines. But when I go to ssh into the other, I still get a request for a password. Once I type in the root password, I get in.

Anonymous rsync is still not working, however.

Thanks!
malden

Offline psoren

  • *
  • 371
  • +0/-0
Re: thank you both for replying!
« Reply #6 on: July 29, 2004, 11:16:26 PM »
Quote from: "malden7794"
Question: isn't the idea of Anonymous rsync created so that keys don't have to be exchanged?  

Are you both using the Anonymous or the secure rsync when you connect?

I have been able to exchange the keys between my two test machines. But when I go to ssh into the other, I still get a request for a password. Once I type in the root password, I get in.

Anonymous rsync is still not working, however.

Thanks!
malden


My server takes a backup from two other servers every nigth via a cronjob. All i did was to follow the howto i posted before here. No extra rpm's installed. The syntax in the cronjob is:

 #!/bin/sh

rsync -avz -e ssh --delete --update --stats root@domain.com:/home/e-smith/files/ibays/from_this/ /ibays/to_this/files/

Also try "man rsync" That helped me a lot.

Per