Re: rsync do shell script password..
Re: rsync do shell script password..
- Subject: Re: rsync do shell script password..
- From: Wayne Melrose <email@hidden>
- Date: Fri, 14 Sep 2007 06:33:26 +0200
On 14/09/2007, at 6:18 AM, Mark J. Reed wrote:
On 9/13/07, Wayne Melrose <email@hidden> wrote:
1.
I can use a variable RSYNC_PASSWORD=mypassword
No, you can't. The man page rsync(1):
Setting RSYNC_PASSWORD to the required password
allows you to run authenticated rsync connections
to a rsync daemon without user intervention. Note
that this does not supply a password to a shell
transport such as ssh.
That last sentence means that it is useless in this case. The
underlying transport you are using for rsync is ssh, and there is no
way to pass a password into ssh from an environment variable or a
file.
That's what I thought (that the underlying transport was shell)
2.
Store the password in a file, then use the command
--password-file=/path/to/password/file
And again:
--password-file
This option allows you to provide a password in a
file for accessing a remote rsync server. Note that
this option is only useful when accessing a rsync
server using the built in transport, not when using
a remote shell as the transport.
Yep.
Rsync over ssh is at the mercy of ssh itself, which as a design point
(since the first S stands for "Secure") does not allow this sort of
stored-password shenanigans.
Now, what you *can* do is use ssh-keygen to generate a public-private
keypair, put the public half in the ~/.ssh/authorized_keys file on the
remote server under the home directory of whoever you're connecting
as. Then you would use ssh-agent to activate your private half of the
key and ssh would then work with no password required.
You could even switch off the secure in secure shell by not
passphrase-protecting your private key, meaning that the ssh-agent
step would not be required. ssh would just work.
But it does require setting up the authorized_keys file, with
appropriate permissions, on every host you want to ssh to. If that's
too burdensome you're pretty much stuck with the expect-based
solution.
Seems like I'd be stuck with an expect script :) actually I could set
up ssh-agent, I was just hoping to find an applescript solution. For
now what I'm doing is mounting the volumes and then using rsync to
connect to the volumes .. I can't see a problem with that for now!?
If the volume is not available then it probably would not be
available with a remote shell command anyway.
Thanks to everyone!
Wayne Melrose
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden