[erlang-questions] ssh client

Kenji Rikitake kenji.rikitake@REDACTED
Tue Sep 7 06:57:56 CEST 2010


http://github.com/jj1bdx/sshrpc/

Far from a complete one - but might be useful.
Kenji Rikitake

In the message <AANLkTi=xDOQ7P8nfCW-=P+98daXyKW=RJhO4NVkvUYsd@REDACTED>
dated Wed, Sep 01, 2010 at 11:17:21AM -0500,
Daniel Goertzen <daniel.goertzen@REDACTED> writes:
> I want to write a program that will chat with another remote program via
> SSH.  Erlang SSH is a bit complex, and I was unable to find an example of
> what I wanted, so I thought I would confirm my approach here before barking
> up the wrong tree.  Here is what I was going to do:
> 
> 
> 1. Open a connection with ssh:connect()
> 2. Open a channel with ssh_connection:session_channel()
> 3. Call ssh_channel:start_link() to create my handler process.
> 4. In my callback module, init() will call ssh_connection:exec() to invoke
> the remote program.
> 5. Incoming data gets sent to my handle_ssh_message() callback.  I send data
> with ssh_connection:send()
> 
> Do I have it right?
> 
> It would be nice if there was a "port" abstraction for an ssh channel, so I
> could treat locally and remotely invoked programs identically...  I guess it
> wouldn't be hard to write my own wrapper for that.
> 
> Thanks,
> Dan.


More information about the erlang-questions mailing list