On Thu, Mar 5, 2009 at 6:58 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Thu, Mar 5, 2009 at 5:55 PM, Brian K. White <brian@aljex.com> wrote:
----- Original Message ----- From: "Greg Freemyer" <greg.freemyer@gmail.com> To: "SUSE Linux" <opensuse@opensuse.org> Sent: Thursday, March 05, 2009 5:29 PM Subject: [opensuse] rsync with password?
All,
I'm trying to connect to a remote rsync server. ie. It is running rssh as the shell and rsync is one of the few allowed programs to run.
From my local machine I can invoke rsync and it connects and rsync asks me for a password. I provide it an all proceeds fine.
I need this to work from a script. So I'm trying to use the RSYNC_PASSWORD environment variable to pass in the password but it is not working.
My simple test script is:
==
#!/bin/sh RSYNC_PASSWORD=<my_password> export RSYNC_PASSWORD
echo RP = $RSYNC_PASSWORD
rsync -avh --delete --stats --max-size=100M --links --timeout=600 /$BACKUP_PATH/config-enc-raw /$BACKUP_PATH/srv-enc-raw b291007@backup.abc.com:mach1/ ==
Am I missing something? the echo is working fine.
FYI: by chance the password I'm trying starts with a shell special char, but I can't see why that would be an issue since the echo works.
Since the remote path only uses one colon, that means you are using either ssh or rsh as the communication layer, not rsync itself (aka native rsync).
RSYNC_PASSWORD only applies to native rsync.
To authenticate non-interactively, you need to do so using whatever methods are available with the communication layer being used.
Since the above command is not using rsync natively (there is only one colon), And since the above command does not explicitly specify the communication means (there is no "-e foo" command line argument), then the above command is communicating by whatever is the compile-time default for "-e". These days almost everywhere, and definitely for all opensuse packages, this is ssh.
So, you need to set up ssh keys for user b291007.
Similarly, the user specification above: "b291007" needs to be a real user in the OS on the remote machine, not an "rsync user" in /etc/rsyncd.secrets. It is not necessary for there to be a user b291007 on the local (client) machine.
Similarly, the remote path specification above: "mach1/" means a directory named "mach1" in user b291007's home directory. NOT an rsync module defined in /etc/rsyncd.conf
You are simply logging in via ssh as user b291007 to host backup.abc.com, just like if you did it manually to get a login prompt and then an interactive shell or if you used sftp.
-- Brian K. White brian@aljex.com http://profile.to/KEYofR
You are a fount of little known knowledge!!
Unfortunately I am paying for a remote backup server that gives me very limited access. I'm just setting things up, so I'm not sure how this will work out.
Getting a ssh connection via a key is unlikely to happen, but I should be able to get them to run rsync as a daemon.
Thanks Greg
To my surprise they have a help page that explains how to upload a .ssh directory and authorized key file to enable ssh access without a password. Easy enough, I just had no idea. I'm too used to ssh'ing in and had not thought about it being done this way. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org