libURL -- FTP over SSH
K
nnoydb at excite.com
Tue Oct 5 10:41:21 EDT 2004
I would invoke ssh via the shell command and the correct ssh cert in my ".ssh" directory (to prevent a password prompt on unix) then simply use libURL with my locally forwarded port. You can pass a option into SSH wich will only establish the port forward and not provide a terminal. If you are using Windows checkout plink and pagent part of the putty suite of tools. I have used them in a previous project and the client was very happy with the solution. The other option is to use open process and communicate with ssh via it's stdin and stdout. From my experience this option is the most flexible (in C++, JAVA, and PERL) but is a bit unstable in RR (and completely unavailable on OS X). The last option I would consider is using the SSH Library which compiles and executes on most platforms but require the coding of a external.
Kevin
-==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=-
Disclaimer:
Any resemblance between the above views and those of my
employer, my terminal, or the view out my window are purely
coincidental.
Any resemblance between the above and my own views is non-deterministic.
The question of the existence of views in the absence of anyone to hold
them
is left as an exercise for the reader. The question of the existence of
the reader
is left as an exercise for the second god coefficient.
(A discussion of non-orthogonal, non-integral polytheism is beyond the
scope of this article.)
--- On Mon 10/04, Sannyasin Sivakatirswami < katir at hindu.org > wrote:
From: Sannyasin Sivakatirswami [mailto: katir at hindu.org]
To: nnoydb at excite.com, use-revolution at lists.runrev.com
Date: Mon, 4 Oct 2004 02:55:25 -1000
Subject: Re: libURL -- FTP over SSH
How would one implement this in a revolution script?<br><br>Sivakatirswami<br><br><br>On Oct 4, 2004, at 2:35 AM, K wrote:<br><br>><br>> May I suggest in using the -R -L options for ssh it creates a static <br>> loop back port for doing such things. For example I use it to login <br>> and encrypt all my VNC traffic sice vnc is not very secure. There is <br>> a document on the vnc web site using ssh with vnc you should probally <br>> consult.<br>><br>> Kevin<br>><br>><br>><br>> -==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=-<br>> Disclaimer:<br>><br>> Any resemblance between the above views and those of my<br>> employer, my terminal, or the view out my window are purely<br>> coincidental.<br>> Any resemblance between the above and my own views is <br>> non-deterministic.<br>><br>> The question of the existence of views in the absence of anyone to <br>> hold<br>> them<br>> is left as an exercise for the reader. The question of the existence of<br>> the reader<br>> is left as an exercise for the second god coefficient.<br>> (A discussion of non-orthogonal, non-integral polytheism is beyond the<br>> scope of this article.)<br>><br>><br>><br>> --- On Sun 10/03, Sannyasin Sivakatirswami < katir at hindu.org > wrote:<br>> From: Sannyasin Sivakatirswami [mailto: katir at hindu.org]<br>> To: use-revolution at lists.runrev.com<br>> Date: Sun, 3 Oct 2004 17:56:49 -1000<br>> Subject: Re: libURL -- FTP over SSH<br>><br>> Andre: Aloha from Hawaii:<br><br>"see some code"<br><br>Not sure if <br>> you meant Dave Cragg's libURL core code or my scripts... I <br>think <br>> you can hack libURL former from within the IDE itself... at least <br>> <br>I could two years ago... haven't dug that deep into the IDE for a <br>> <br>while. but I would be surprised if you can do the encryption thing <br>> over <br>port 22... ;-)<br><br>but, the trancript from interarchy's <br>> FTP over SSH looks like any <br>passive connection <br>> would...<br><br>Below is a typical script... it uploads a set of <br>> photos for a daily web <br>page and and index file for <br>> www.gurudeva.org. I have mode set to ACTIVE <br>in this one. but <br>> that's going to fail for sure to our new OLM <br>server... (really <br>> fabulous managed server services there btw... I'm <br>really happy <br>> with them, support is great..)<br><br>pretty simple.. never more than <br>> about 43 photos, max, it's a small <br>daily upload, but I still get <br>> errors, typically I'll see the last 150 <br>entry in t<br>> he log:<br><br>150 Opening BINARY mode data connection for <br>> <br>/export/vhost/org/g/gurudeva/www/public_html/01-guestsVisiting-10 <br>> <br>-1.jpg.<br><br>then... hangs.. and then "Error: Socket time out" <br>> from libURL...<br><br>I'd would rather not try to set up the server to <br>> do the <br>> job...<br><br>Thanks<br>Sivakatirswami<br><br>===========<br><br>global <br>> tUrlStem, tFiles, tSourcePath,tMonth,tYear,tDateString, <br>> <br>gArchiveFolder<br><br>on mouseUp<br> if gArchivefolder is empty <br>> then<br> answer folder "Choose your TAKA archive folder"<br> <br>> if it is empty then exit mouseup<br> put it & "/" into <br>> gArchiveFolder<br> end if<br><br><br> setDateItems<br> ## <br>> returns the date String e.g. "December_09_2002"<br><br> ### set log <br>> in variables<br> put "www.REMOTESERVER.com" into tHost<br> put <br>> "USER" into tUser<br> put "PASSWORD" into tPass<br> ## create a <br>> path string for the new directory for today<br><br> put <br>> "/gig/htoday/public_html/today/Archives/Past/" into tPath<br>> <br> put tPath & tYear &"/" & tMonth& "/" & tDateString &"/" into <br>> tFolder<br><br> ######## send the files<br><br> ## get a local <br>> file list with paths<br> if gArchivefolder is empty then<br> <br>> answer folder "Find directory for upload to San Diego"<br> if it <br>> is not empty then<br> put it into gArchivefolder<br> <br>> else<br> exit mouseUp<br> end if<br> end if<br><br> <br>> put gArchiveFolder in
to tSourcePath<br> set the directory to <br>> tSourcePath<br> put the files into tFiles<br><br># skip dot <br>> files...<br> if char 1 of line 1 of tFiles ="." then delete line <br>> 1 of tFiles<br><br>## skip temp file...<br> delete line <br>> (lineoffset ("nakshatra",tFiles)) of tFiles<br><br> put <br>> "ftp://user:password@" & tHost & tFolder into tUrlStem<br> put <br>> the long id of field "ftp log" into tField<br> libUrlSetLogField <br>> tField<br> LibUrlSetFTPMode "Active"<br><br> set the <br>> socketTimeoutInterval to 20000<br> uploadNe<br>> xt<br><br>end MouseUp<br><br>on uploadNext<br> if line 1 of tFiles <br>> is not empty then<br> put tUrlStem & (line 1 of tFiles) into <br>> tUrl<br> put tSourcePath & (line 1 of tFiles) into tFilePath<br> <br>> put "loading... " & tURL & tFilePath into fld "Watch"<br> <br>> libUrlFtpUploadFile tFilePath, tUrl, "loadDone"<br> else<br> <br>> put "Upload Complete!" into fld "watch"<br> wait 20 ticks<br>## <br>> does the same thing to a different server in Honolulu:<br> send <br>> mouseup to btn "FTP to Mahiai"<br> end if<br>end <br>> uploadNext<br><br>on loadDone pUrl, pStatus<br> if pStatus is not <br>> "uploaded" then<br> get libUrlErrorData (pUrl)<br> answer <br>> it<br> put line 1 of tFiles & cr & it & cr & "--------" & cr into <br>> tFailures<br> delete line 1 of tFiles<br> put "Did not <br>> upload:" & cr & tFailures<br> unload url pUrl<br> else<br> <br>> put (pUrl & " was uploaded successfully.") into fld "watch"<br> <br>> unload url pUrl<br> delete line 1 of tFiles<br><br>> wait 30 ticks<br><br> uploadNext<br> end if<br><br>end <br>> loadDone<br><br><br>On Oct 3, 2004, at 5:00 PM, Andre Garzia <br>> wrote:<br><b<br>> r>><br>> Oh boy.... I don't know if it can be done easily, if you <br>> need I can <br>> send you my FTPd code, the FTP Server side is <br>> almost implemented, <br>> there need to fix CWD and to implement <br>> STOR, but it might help to see <br>> some libURL code that tries to <br>> ftp things.<br>><br>> Also, what about doing the other way, set up the <br>> ftp server on your <br>> side and allow them to connect?<br>><br>> <br>> cheers<br>> andre<br>><br>><br>><br>> On Oct 3, 2004, at 11:44 PM, <br>> Sannyasin Sivakatirswami wrote:<br>><br>>> Can libURL do FTP over <br>> SSH?<br>>><br>>> ... where the control connection is encrypted on <br>> port 22, but the <br>>> data connection is unencrypted and a new <br>> random port issued by the <br>>> remote server for a new connection <br>> to open a per file basis,... i.e. <br>>> appears to handshake like <br>> PASSIVE mode...<br>>><br>>> I had a terrible time with regular FTP to <br>> our new dedicated server at <br>>> the OLM Data center in <br>> Connecticutt. They turned off ACTIVE for the <br><br>>>> whole center because of attacks, but regular FTP on port 21/PASSIVE <br>>>> <br>>> kept failing... the old problem of two firewalls unable to <br>>>> sort it <br>>> out... I couldn't get a pipe to stand up for more <br>>>> then 10 files... 2 <br>>> minutes...<br>>><br>>> When I switched to <br>>>> SSH over FTP... it was solid as a rock -- in fact <br>>> I've been <br>>>> uploading data now for 21 hours with Interarchy, from <br>>> Hawaii <br>>>> to Connecticutt.. and there hasn't been a single broken pipe <br>>> <br>>>> in all that time... 22,000 files-3 gigs of data uploaded and 2.5 <br>>>> gigs <br>>> more to go...<br>>><br>>> Anyway I need to point all my <br>>>> Rev web generator scripts to the new <br>>> server and hope that <br>>>> libURL will be able to do as good a job as <br>>> interArchy, <br>>>> ideally it could do FTP over SSH but don't see any SSH <br>>> entry <br>>>> in the docs. If not, I may be forced to resort to issuing <br>>> <br>>>> applescripts commands to tell interarchy to do the job... not a <br>>>> <br>>> pleasant prospect, when single line co<br>> mmands
are there in Rev.<br>>><br>>> Sannyasin Sivakatirswami<br>>> <br>> Himalayan Academy Publications<br>>> at Kauai's Hindu Monastery<br>>> <br>> katir at hindu.org<br>>><br>>> www.HimalayanAcademy.com,<br>>> <br>> www.HinduismToday.com<br>>> www.Gurudeva.org<br>>> <br>> www.Hindu.org<br>>><br>>> <br>> _______________________________________________<br>>> use-revolution <br>> mailing list<br>>> use-revolution at lists.runrev.com<br>>> <br>> http://lists.runrev.com/mailman/listinfo/use- <br>> revolution<br>>><br>>><br>> -- <br>> Andre Alves Garzia ð 2004 ð <br>> BRAZIL<br>> http://studio.soapdog.org<br>><br>> <br>> _______________________________________________<br>> use-revolution <br>> mailing list<br>> use-revolution at lists.runrev.com<br>> <br>> http://lists.runrev.com/mailman/listinfo/use- <br>> revolution<br>><br><br>_______________________________________________< <br>> br>use-revolution mailing <br>> list<br>use-revolution at lists.runrev.com<br>http://lists.runrev.com/ <br>> mailman/listinfo/use-revolution<br><br>><br>> _______________________________________________<br>> Join Excite! - http://www.excite.com<br>> The most personalized portal on the Web!<br>> _______________________________________________<br>> use-revolution mailing list<br>> use-revolution at lists.runrev.com<br>> http://lists.runrev.com/mailman/listinfo/use-revolution<br>><br><br>
_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
More information about the use-livecode
mailing list