File: ssh_sshd.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 (74 lines) | stat: -rw-r--r-- 1,246 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
70
71
72
73
74
.TH ssh_sshd 3 "ssh  0.9.9.6" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
ssh_sshd \- SSH server with erlang shell\&.
.SH DESCRIPTION
.LP
This module implements an erlang shell as an SSH server\&.

.SH EXPORTS
.LP
.B
listen(Port) -> {ok, Pid}|{error, Error}
.br
.B
listen(Port, Options) -> {ok, Pid}|{error, Error}
.br
.B
listen(Addr, Port, Options) -> {ok, Pid}|{error, Error}
.br
.RS
.TP
Types
Addr = string()
.br
Port = integer()
.br
Options = [{Option, Value}]
.br
.RE
.RS
.LP
Create a listener on the given port\&. (It calls \fIssh_cli:listen\fR with \fIshell:start/0\fR as argument\&.) An SSH client can be used to connect to the listener and execute erlang commands\&.
.LP
Unix example:

.nf
1> ssh_sshd:listen(9999, [{system_dir, "\&."}])

<0\&.59\&.0>
        
.fi
.LP
On a unix shell:

.nf
bash@balin$ ssh -p 9999 balin

Eshell V5\&.4\&.9\&.1  (abort with ^G)
1> exit()\&.

Connection to balin closed\&.
bash@balin$ 
        
.fi
.LP
This assumes that the current dir contains a private host key\&.
.LP
For options, see \fIssh_cli:listen/3\fR and \fIssh_cm:listen/4\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\&.
.RE