ssh client

Daniel Goertzen daniel.goertzen@REDACTED
Wed Sep 1 18:17:45 CEST 2010


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