plink from windows to linux under xemacs using ssh works great

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I was on the verge of posting a question because I had a lot of
trouble getting this to work, mostly with quoting, but it finally
worked.  The putty doc was great, but I had trouble passing arguments
through to the unix script.  So now that its working, I thought I'd
post to give an example, since from searching the forum it looks like
others try this same thing also.

I'm setting up my native-windows xemacs to do compiles on our linux
machine running openssh 2.  I have xemacs issuing the following
command in a windows non-cygwin shell:

pageant.exe C:\putty\private.ppk -c plink -v -X -batch mysession \
/bin/csh -c 'cd subdir; doitscript arg1 arg2 arg3 >& alloutput'

pageant.exe and putty.exe are in my windows path.  The signature is
pasted into my ~/.ssh/authorized_keys file as per the putty doc.
pageant already has the passphrase, so there's no prompting. This
works perfectly; either the problem others posted about a couple years
ago on this list have been fixed or I'm avoiding those problems by
using windows-native xemacs instead of cygwin-xemacs. The arguments
get passed to the doitscript; that was the hardest part. The key is
the single forward quotes around the shell command line, no other
quotes will work.  Without quotes plink tries to interpret the >& and
gets an error.  (I suppose if I was a linux guru I would have
instinctively known the right quotes to use).

I haven't figured out how to capture the output of the script back
through the ssh connection to xemacs; that's why I redirect it to a
file, this is then loaded by xemacs by the lisp command that puts
together the plink command and executes it.  I also don't have a good
way to tell when its done, the command line execution returns to
xemacs immediately, so I have a hard-coded delay in my lisp code.  But
it works!

Thanks to the putty team for a cool tool!

Re: plink from windows to linux under xemacs using ssh works great (Jerry Goodwin) writes:
Quoted text here. Click to load it

You are avoiding those problems by using a native xemacs.  There's a
known problem with trying to use pageant from cygwin, documented in:
Quoted text here. Click to load it

You're welcome!


Site Timeline