Re: rsync do shell script password..
Re: rsync do shell script password..
- Subject: Re: rsync do shell script password..
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 14 Sep 2007 00:18:49 -0400
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.
> 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.
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.
>
> do shell script "echo mypassword > /path/to/password/file"
>
> I did not try echo-ing the password, I'll have a crack at this and report
> back if it works
>
>
> do shell script "rsync
> --password-file=/path/to/password/file -Ezpu ..."
>
>
>
> Also tired this with no luck..
>
>
> 3.
> Use ssh-keygen to store the passwords..? Not really what I want.
>
> No clue, but you said you don't want it anyway. =)
>
>
>
> --Chris Nebel
> AppleScript Engineering
>
>
> Thanks ..
>
> 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
>
--
Mark J. Reed <email@hidden>
_______________________________________________
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