This module implements a CLI (Command Line Interface), for an SSH server. It's used by ssh_sshd to provide an interactive erlang shell as an ssh server.
Since ssh_cli uses the group module, the CLI provides full editing just like in the erlang shell, with history (ctrl-p and ctrl-n), line editing and configurable tab expansion (completion).
A full example of how to use ssh_cli is provided in ssh/examples/ssh_sample_cli.erl.
listen(Shell)
listen(Shell, Port)
listen(Shell, Port, Options)
listen(Shell, Addr, Port, Options)
Types:
Shell = pid() | fun()
Port = integer()
Addr = string()
Options = [{Option, Value}]
Option = atom()
Value = term()
Starts a daemon listening on Port. The Shell fun is a function spawning a shell process, containing a read-eval-print-loop using ordinary erlang io (e.g. get_line/1 and fprint).
The daemon's group leader will be connected to the SSH daemon, so that the io will be sent to the remote SSH shell client.
An example of how ssh_cli can be used can be found in ssh/examples/ssh_cli_sample.erl.
The module ssh_sshd is implemented using ssh_cli.
For options, see ssh_cm:listen.
stop(Pid) -> ok | {error, Reason}
Types:
Pid = pid()
Reason = atom()
Stops the listener given by Pid, existing connections will stay open.