running SCP as a process

Phil Davis revdev at pdslabs.net
Sun Jan 5 02:09:09 EST 2014


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 -

-- 
Phil Davis





More information about the use-livecode mailing list