running SCP as a process
Richard Gaskin
ambassador at fourthworld.com
Sun Jan 5 11:50:21 EST 2014
Without seeing the actual SCP code it's hard to determine the source of
the problem, but I suspect it's because SCP is designed to prevent
allowing passwords to be included as plain text in shell scripts, since
that would obviate the "S" in "SCP".
The solution seems to be setting up shared keys instead of passwords for
shell access, which has been tricky for me but given the great many
tutorials all over the Web the problem seems to be less with shared keys
than my own attempting it pre-coffee.
Of course it would be far better to just have SFTP in libURL, since then
we could use it on every supported platform, even Windows.
But in the meantime, where SCP can be an acceptable workaround for the
absence of SFTP you'll want to set up shared-key authentication.
<https://www.google.com/webhp#q=setting+up+shared+keys+for+SSH+on+OS+X>
Let me know which tutorial you found especially helpful for that, as
I'll need it soon myself. If I get to it before then I'll pass along
the URL.
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
On 1/4/14 11:09 PM, Phil Davis wrote:
> Hi folks,
>
> I'm trying to upload a file to a server using scp. It works fine from
> Terminal (Mac), but fails when run as a process in LC.
>
> In my LC script, the 'verbose' output from scp tells me:
> - the connection was established
> - it was authenticated with RSA key
>
> but something happens at password time. From the scp output:
>
> debug1: Next authentication method: password
> debug1: read_passphrase: can't open /dev/tty: Device not configured
> debug1: Authentications that can continue: publickey,password
> Permission denied, please try again.
> debug1: read_passphrase: can't open /dev/tty: Device not configured
> debug1: Authentications that can continue: publickey,password
> Permission denied, please try again.
> debug1: read_passphrase: can't open /dev/tty: Device not configured
> debug1: Authentications that can continue: publickey,password
> debug1: No more authentication methods to try.
> Permission denied (publickey,password).
> lost connection
> --- CLOSED ---
>
>
> Here is my script:
>
> -- in the 'start' button --
>
> on mouseUp
> try
> close process (fld "command")
> wait until fld "command" is not among the lines of the
> openProcesses
> end try
>
> open process (fld "command") for update
> readThisProcess
> end mouseUp
>
>
>
> -- in the stack script --
>
> command readThisProcess
> read from process (fld "command") for 1 line
> if it = empty then
> send "closeThisProcess" to me in 1 tick
> exit readThisProcess
> end if
>
> put it after fld "status"
> set the vScroll of fld "status" to the formattedHeight of fld
"status"
> if it contains "password:" then write "<myActualPassword>" & CR to
> process (fld "command")
> send "readThisProcess" to me in 1 tick
> end readThisProcess
>
>
> command closeThisProcess
> close process (fld "command")
> put "--- CLOSED ---" after fld "status"
> end closeThisProcess
>
>
> --------------
>
> It doesn't seem to like the way I'm writing the password to the process,
> so I tried it with and without a CR on the end. I'm in unfamiliar
> territory. Seems to me dev/tty shouldn't be getting involved, but maybe
> I'm wrong.
>
> Any insights you can offer will be greatly appreciated!
>
> Thanks -
>
More information about the use-livecode
mailing list