[Ericsson AB]

ssh_sshd

MODULE

ssh_sshd

MODULE SUMMARY

SSH server with erlang shell.

DESCRIPTION

This module implements an erlang shell as an SSH server.

EXPORTS

listen(Port) -> {ok, Pid}|{error, Error}
listen(Port, Options) -> {ok, Pid}|{error, Error}
listen(Addr, Port, Options) -> {ok, Pid}|{error, Error}

Types:

Addr = string()
Port = integer()
Options = [{Option, Value}]

Create a listener on the given port. (It calls ssh_cli:listen with shell:start/0 as argument.) An SSH client can be used to connect to the listener and execute erlang commands.

Unix example:

1> ssh_sshd:listen(9999, [{system_dir, "."}])
<0.59.0>
        

On a unix shell:

bash@balin$ ssh -p 9999 balin
Eshell V5.4.9.1  (abort with ^G)
1> exit().
Connection to balin closed.
bash@balin$ 
        

This assumes that the current dir contains a private host key.

For options, see ssh_cli:listen/3 and ssh_cm:listen/4.

stop(Pid) -> ok | {error, Reason}

Types:

Pid = pid()
Reason = atom()

Stops the listener given by Pid.

AUTHORS

Jakob Cederlund - support@erlang.ericsson.se

ssh 0.9.4
Copyright © 1991-2006 Ericsson AB