File: ssh_cli.3

package info (click to toggle)
erlang-manpages 1%3A12.b.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,188 kB
  • ctags: 2
  • sloc: makefile: 68; perl: 30; sh: 15
file content (69 lines) | stat: -rw-r--r-- 1,686 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.TH ssh_cli 3 "ssh  0.9.9.6" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
ssh_cli \- SSH Command Line Interface\&.
.SH DESCRIPTION
.LP
This module implements a CLI (Command Line Interface), for an SSH server\&. It\&'s used by \fIssh_sshd\fR to provide an interactive erlang shell as an ssh server\&.
.LP
Since \fIssh_cli\fR uses the \fIgroup\fR 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)\&.
.LP
A full example of how to use \fIssh_cli\fR is provided in \fIssh/examples/ssh_sample_cli\&.erl\fR\&.

.SH EXPORTS
.LP
.B
listen(Shell)
.br
.B
listen(Shell, Port)
.br
.B
listen(Shell, Port, Options)
.br
.B
listen(Shell, Addr, Port, Options)
.br
.RS
.TP
Types
Shell = pid() | fun()
.br
Port = integer()
.br
Addr = string()
.br
Options = [{Option, Value}]
.br
Option = atom()
.br
Value = term()
.br
.RE
.RS
.LP
Starts a daemon listening on \fIPort\fR\&. The \fIShell\fR fun is a function spawning a shell process, containing a read-eval-print-loop using ordinary erlang \fIio\fR (e\&.g\&. \fIget_line/1\fR and \fIfprint\fR)\&.
.LP
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\&.
.LP
An example of how \fIssh_cli\fR can be used can be found in \fIssh/examples/ssh_cli_sample\&.erl\fR\&.
.LP
The module \fIssh_sshd\fR is implemented using \fIssh_cli\fR\&.
.LP
For options, see \fIssh_cm:listen\fR\&.
.RE
.LP
.B
stop(Pid) -> ok | {error, Reason}
.br
.RS
.TP
Types
Pid = pid()
.br
Reason = atom()
.br
.RE
.RS
.LP
Stops the listener given by \fIPid\fR, existing connections will stay open\&.
.RE