[erlang-bugs] ssh module, enhancement proposal for custom ssh_cli.

Ingela Anderton Andin ingela@REDACTED
Thu Sep 25 17:52:25 CEST 2008


Hi,

We have accepted this patch.  We of course want to retain some
kind of backwards compatibility with was offered before.
The ssh application has been quite extensively remodeled and we are
not really a 100 % satisfied with it yet but the circumstances called for
a new release of the application and it still might have a few rough corners
so to speak.

Regards Ingela Erlang/OTP - Ericsson

YAMASHINA Hio wrote:
> Hi.
>
> I wanted to write customized ssh daemon application.
> But It looks like no way to trap ssh-packets until shell
> is started.
> (and no way to get ssh_cm instance from shell function.)
>
> I wrote a patch for writing original ssh-daemon application
> by replace ssh_cli with another module which can be selected
> by caller.
>
>     % ssh_cli option:
>     % - module name which implements child_spec/4
>     % - or fun/4
>     % - default is 'ssh_cli'
>     % these functions should return
>     % - fun/0 closure which returns child_pid.
>     % - or just a child_spec.
>
>     ssh:daemon(22, [
>         {ssh_cli, ?MODULE },
>         {system_dir, "xxx"},
>         {pwdfun, fun pwdfun/2}
>     ]).
>
>     child_spec(_Shell, _Address, _Port, _Options) ->
>         ChildSpecFun = fun() ->
>             ChildPid = spawn(fun() ->
>                 ?MODULE:init()
>             end),
>             ChildPid
>         end,
>         ChildSpecFun.
>
>
> Like previous ssh_cm:listen.
>
>     ssh_cm:listen(
>         fun() ->
>             spawn_link(?MODULE, init, [])
>         end,
>         22,
>         [
>           {system_dir, "."},
>           {pwdfun, fun check_auth/2}
>         ]
>     ).
>
>
> Thank you.
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-bugs




More information about the erlang-bugs mailing list