File: ssh_cli.html

package info (click to toggle)
erlang-doc-html 1%3A11.b.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,284 kB
  • ctags: 10,724
  • sloc: erlang: 505; ansic: 323; makefile: 62; perl: 61; sh: 45
file content (116 lines) | stat: -rw-r--r-- 3,384 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>ssh_cli</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
  <STYLE TYPE="text/css">
<!--
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
  <IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>ssh_cli</H1>
</CENTER>

<H3>MODULE</H3>
<DIV CLASS=REFBODY>
ssh_cli
</DIV>

<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
SSH Command Line Interface.
</DIV>

<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>

<P>This module implements a CLI (Command Line Interface),
for an SSH server. It's used by <CODE>ssh_sshd</CODE> to provide
an interactive erlang shell as an ssh server.
<P>Since <CODE>ssh_cli</CODE> uses the <CODE>group</CODE> 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).
<P>A full example of how to use <CODE>ssh_cli</CODE> is provided
in <CODE>ssh/examples/ssh_sample_cli.erl</CODE>.
</DIV>

<H3>EXPORTS</H3>

<P><A NAME="listen/1"><STRONG><CODE>listen(Shell)</CODE></STRONG></A><BR>
<A NAME="listen/2"><STRONG><CODE>listen(Shell, Port)</CODE></STRONG></A><BR>
<A NAME="listen/3"><STRONG><CODE>listen(Shell, Port, Options)</CODE></STRONG></A><BR>
<A NAME="listen/4"><STRONG><CODE>listen(Shell, Addr, Port, Options)</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Shell = pid() | fun()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Addr = string()</CODE></STRONG><BR>
<STRONG><CODE>Options = [{Option, Value}]</CODE></STRONG><BR>
<STRONG><CODE>Option = atom()</CODE></STRONG><BR>
<STRONG><CODE>Value = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Starts a daemon listening on <CODE>Port</CODE>. The <CODE>Shell</CODE>
         fun is a function spawning a shell process, containing a
         read-eval-print-loop using ordinary erlang <CODE>io</CODE> (e.g.
         <CODE>get_line/1</CODE> and <CODE>fprint</CODE>).
<P>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.
<P>An example of how <CODE>ssh_cli</CODE> can be used can
         be found in <CODE>ssh/examples/ssh_cli_sample.erl</CODE>.
<P>The module <CODE>ssh_sshd</CODE> is implemented using
         <CODE>ssh_cli</CODE>.
<P>For options, see <CODE>ssh_cm:listen</CODE>.

</DIV>

<P><A NAME="stop/1"><STRONG><CODE>stop(Pid) -&#62; ok | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Pid = pid()</CODE></STRONG><BR>
<STRONG><CODE>Reason = atom()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Stops the listener given by <CODE>Pid</CODE>, existing connections
         will stay open.
</DIV>

<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Jakob Cederlund - support@erlang.ericsson.se<BR>

</DIV>
<CENTER>
<HR>
<SMALL>ssh 0.9.5<BR>
Copyright &copy; 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>