You can create a passphraseless key pair by just running ssh-keygen -f filename.

[EMAIL PROTECTED]:~$ ssh-keygen -t rsa -f backupkey
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in backupkey.
Your public key has been saved in backupkey.pub.
The key fingerprint is:
a5:ac:20:3c:16:1e:31:01:39:44:e2:53:07:9e:9b:70 [EMAIL PROTECTED]

Then put the backupkey.pub in the .ssh/authorized_keys file for the backup user.

Then do an:

rsync -avze"ssh -i backupkey" [EMAIL PROTECTED]:/path /local/path

Google around, there's tons of info on this. I'd recommend taking a look at rsnapshot, as it's a good way to keep incremental backups without using a ton of room as it does hardlinks.

Mark



Néstor wrote:
Yes, I did read the man pages and I asked for help because when I tried
rsync -avz  host1:/home/www/ /home/www --password-file=/root/rsync_pwd

It will ask me for the password on host1

I also tried this:
export RSYNC_PASSWORD=XXXXXXX; rsync -avz  host1:/home/www/ /home/www

It will also asked for the host1 password.

Thanks,

Nestor :-)

On Fri, May 30, 2008 at 1:08 PM, Urivan Saaib <[EMAIL PROTECTED]> wrote:

Nestor,

man rsync


set RSYNC_PASSWORD='yourpassword'

or

rsync -avz  host1:/home/www/ /home/www --password-file=password_file

Regards,

==============Original message text===============
On Fri, 30 May 2008 12:42:48 PDT "Néstor" wrote:

When running the rsync command to copy files from one host to another how
do
I pass teh password?

This is my command:
rsync -avz  host1:/home/www/ /home/www

It always as for the password and I want to set it up to run as a cron job.

Thnaks,

Néstor

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
===========End of original message text===========



Urivan A. Flores Saaib
CiberLinux Networking
Email: [EMAIL PROTECTED]



--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list





--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to