[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rsync with public/private keys/no passwords

James Pifer wrote:
Yes, even though it's a big no-no I'm doing this all as root. What you
said is correct, created the rsa key, copied it and cat'ed it to
authorized_keys for root on the remote machine.

I added the root@ to the rsync command and it's still prompting for

The most frustrating thing is that I had this working once before and
documented it when I did it the first time. I'm following the same steps
and I can't get it. The machine I had it working on is unrecoverable, so
I can't do any comparison.



Try this:

1. make sure ssh and rsync are installed on both computers
2. ssh-keygen -t dsa as root
3. choose a location other than /root/.ssh/id_dsa (ex. /root/.ssh/remotehost.id_dsa)
4. enter a BLANK passphrase
5. copy the /root/.ssh/remotehost.id_dsa.pub file and paste the file in or at the end of the remotehost's /root/.ssh/authorized_keys file

6. test if you can login using ssh remotehost ; if you can't login, add the -v flag and check permissions for /root/.ssh on both computers (should be chmod 700 with the files inside the directory 600). Also, check the sshd_config file to see if root is permitted to login.

8. now you can rsync a local directory onto the remotehost! here's an example: /usr/bin/rsync -e ssh -avzp --exclude "*.journal" --exclude "dnscache/" --exclude "dnscachex/" --delete /home remotehost:/var/backups/mycomputer/ which will archive and mirror /home onto the remotehost's /var/backups/mycomputer directory and keep all the permissions. Slashes matter, this works for me though. Note that *.journal are the journal files on ext3 partitions and don't need to be copied and the --delete flag can be omitted in case you want to keep old file that have been deleted archived on the remotehost side permenently.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]