[erlang-questions] Erlang SSH examples

229 views
Skip to first unread message

Radu Voicilas

unread,
Apr 4, 2010, 7:33:54 AM4/4/10
to erlang-q...@erlang.org
Hi guys,

Are there any [very] basic examples of how to use the ssh module from Erlang?
I've only found this one (http://easyerl.blogspot.com/2007/11/experimenting-with-erlang-ssh-support.html) and the documentation.

Thanks,
Radu.

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questio...@erlang.org

黃耀賢 (Yau-Hsien Huang)

unread,
Apr 4, 2010, 9:25:19 AM4/4/10
to erlang-q...@erlang.org
Jungle of Erlang codes (
http://jungerl.sourceforge.net/<http://jungerl.cvs.sourceforge.net/jungerl/>
)
have
an implementation of SSH, too.

Radu Voicilas

unread,
Apr 4, 2010, 2:04:36 PM4/4/10
to "黃耀賢 (Yau-Hsien Huang)", erlang-q...@erlang.org
Thanks for the pointer to jungerl - I was a little bit confused about ssh_cm, but it became clear after I checked the source for that module.

I am trying to come up with an automatic deployment system for a legacy code base (which is written in Python) and the only way that I can do that is by ssh-ing as my user on the given host, sudo as root and run the deploy command. The only problem I encounter here is how I could do something like this (sorry for the imperative pseudocode):

if ssh_connection:send(Connection, ChannelId, "sudo su -").startswith("[sudo] password"):
ssh_connection:send(Connection, ChannelId, "password)
ssh_connection:send(Connection, ChannelId, "deploy project")
...

Thank you,
Radu.

Tony Rogvall

unread,
Apr 4, 2010, 5:27:40 PM4/4/10
to 黃耀賢 (Yau-Hsien Huang), erlang-q...@erlang.org
Do not use the jungerl version!
It was merged with the OTP ssh a long time ago. (And supported ;-)

/Tony

Steve Davis

unread,
Apr 4, 2010, 10:20:19 PM4/4/10
to erlang-q...@erlang.org
Don't forget there's also a "client_server.erl" example in erts/lib/
ssl-xxx/examples/src

/s

On Apr 4, 6:33 am, Radu Voicilas <r...@picohost.net> wrote:
> Hi guys,
>
> Are there any [very] basic examples of how to use the ssh module from Erlang?

> I've only found this one (http://easyerl.blogspot.com/2007/11/experimenting-with-erlang-ssh-sup...) and the  documentation.


>
> Thanks,
> Radu.
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> Seehttp://www.erlang.org/faq.html

> To unsubscribe; mailto:erlang-questions-unsubscr...@erlang.org

Kenji Rikitake

unread,
Apr 6, 2010, 1:44:45 AM4/6/10
to Radu Voicilas, erlang-q...@erlang.org
http://github.com/jj1bdx/sshrpc/

Kenji Rikitake

In the message <4BB87922...@picohost.net>
dated Sun, Apr 04, 2010 at 02:33:30PM +0300,


Radu Voicilas <ra...@picohost.net> writes:
> Hi guys,
>
> Are there any [very] basic examples of how to use the ssh module from Erlang?
> I've only found this one (http://easyerl.blogspot.com/2007/11/experimenting-with-erlang-ssh-support.html) and the documentation.

________________________________________________________________

Steve Davis

unread,
Apr 6, 2010, 2:29:01 AM4/6/10
to erlang-q...@erlang.org
My apologies for this total misdirection!

/s

Reply all
Reply to author
Forward
0 new messages