Re: How to call a remote program through SSH tunnel and pass a local file as parameter?

From: Antti Tolamo (usenet_at_linux.tola.org)
Date: 02/05/05


Date: Sat, 05 Feb 2005 04:15:24 +0200

Peter Meister wrote:
> Ok, If I would have the program on the local machine I could call this from the command line
> by a statment like
>
> myprog myfile.dat
>
> Unfortunately the program is on another machine installed. Between the two
> machines there is an already successfully running SSH connection.
>
> How do I call in this scenario the remote progr myprog and pass
> the local file myfile.dat?
>
> cu
> Peter
>

Don't know what SSH or OS you use, but for OpenSSH I and Linux can guide
somewhat.

You could try this:

cat > myfile.dat | ssh -l your_login your_host "myprog < cat"

basically you read file to stream/pipe first, then open connection
and do commands combining the command and the output as one on
the other end.
Depending is the myprog on path or not, you may need to use
./myprog if it's not one the path but on folder where you log on.

Of course I don't know how the program at other end works. If
it takes input above should work, if it reads information
from a file it can be another thing.

I haven't tested combining the command to input, but the piping
and doing command above way do work.

Antti



Relevant Pages

  • Re: High latency shell environment
    ... > I've been doing just fine using ssh over 1000ms latency connections ... as a front end to your 'ssh'. ... This means that editing the command line is ... them to your local machine, edit them, and copy them back. ...
    (comp.unix.shell)
  • Re: How to call a remote program through SSH tunnel and pass a local file as parameter?
    ... If I would have the program on the local machine I could call this ... Many people seem to think that rsa keys must be created ... Some sophistications to this script include the ability to use something ... like %f to include the file in your command line. ...
    (comp.security.ssh)
  • Move to Server Still not working.
    ... I been using my local machine as ... When i checked the Event Viewer on the Server it is causing the following ... Instead, open a command window, ... After you set user rights in Windows Explorer, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: command line samba to copy files
    ... >I need some pointers on how to use samba from command line. ... from your local machine to the samba share, ... smb: \> help ...
    (Fedora)
  • Re: How to call a remote program through SSH tunnel and pass a local file as parameter?
    ... If I would have the program on the local machine I could call this ... > from the command line ... > by a statment like ... > How do I call in this scenario the remote progr myprog and pass ...
    (comp.security.ssh)