spelling
[unix-history] / usr / src / usr.bin / telnet / telnet.1
CommitLineData
24854a1c
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5c2bded5 5.\" @(#)telnet.1 6.3 (Berkeley) %G%
24854a1c 6.\"
12f553b7 7.TH TELNET 1C ""
24854a1c
KM
8.UC 5
9.SH NAME
5c2bded5
GM
10telnet \- user interface to the
11.B TELNET
12protocol
24854a1c
KM
13.SH SYNOPSIS
14telnet [ host [ port ] ]
15.SH DESCRIPTION
16.I Telnet
5c2bded5
GM
17is used to communicate with another host using the
18.B TELNET
19protocol.
20If
24854a1c
KM
21.I telnet
22is invoked without arguments, it enters command mode,
23indicated by its prompt (\*(lqtelnet>\*(rq).
24In this mode, it accepts and executes the commands listed below.
25If it is invoked with arguments, it performs an
5c2bded5 26.B open
24854a1c
KM
27command (see below) with those arguments.
28.PP
29Once a connection has been opened,
30.I telnet
5c2bded5
GM
31enters an input mode.
32The input mode entered will be either \*(lqcharacter at a time\*(rq
33or \*(lqline by line\*(rq
34depending on what the remote system supports.
35.PP
36In \*(lqcharacter at a time\*(rq mode, most
37text typed is immediately sent to the remote host for processing.
38.PP
39In \*(lqline by line\*(rq mode, all text is echoed locally,
40and (normally) only completed lines are sent to the remote host.
41The \*(lqlocal echo character\*(rq (initially \*(lq^E\*(rq) may be used
42to turn off and on the local echo
43(this would mostly be used to enter passwords
44without the password being echoed).
45.PP
46In either mode, if the
47.I localchars
48toggle (see below) is TRUE,
49the user's
50.IR quit ,
51.IR intr ,
52and
53.I flush
54characters are trapped locally, and sent as
55.B TELNET
56protocol sequences to the remote side.
57There are options (see
58.B toggle
59.I autoflush
60and
61.B toggle
62.I autosynch
63below)
64which cause this action to flush subsequent output to the terminal
65(until the remote host acknowledges the
66.B TELNET
67sequence) and flush previous terminal input
68(in the case of
69.I quit
70and
71.IR intr ).
72.PP
73While connected to a remote host,
24854a1c 74.I telnet
5c2bded5 75command mode may be entered by typing the
24854a1c 76.I telnet
12f553b7 77\*(lqescape character\*(rq (initially \*(lq^]\*(rq).
24854a1c
KM
78When in command mode, the normal terminal editing conventions are available.
79.PP
5c2bded5
GM
80.B COMMANDS
81.PP
24854a1c 82The following commands are available.
5c2bded5
GM
83Only enough of each command to uniquely identify it need be typed
84(this is also true for arguments to the
85.BR mode ,
86.BR set ,
87.BR toggle ,
88and
89.B display
90commands).
24854a1c
KM
91.PP
92.TP
5c2bded5
GM
93.B open \fIhost\fP \fR[\fP \fIport\fP \fR]\fP
94.br
95Open a connection to the named host.
96If no port number
24854a1c
KM
97is specified,
98.I telnet
5c2bded5
GM
99will attempt to contact a
100.B TELNET
101server at the default port.
24854a1c
KM
102The host specification may be either a host name (see
103.IR hosts (5))
5c2bded5
GM
104or an Internet address specified in the \*(lqdot notation\*(rq (see
105.IR inet (3N)).
24854a1c
KM
106.TP
107.B close
5c2bded5
GM
108.br
109Close a
110.B TELNET
111session and return to command mode.
24854a1c
KM
112.TP
113.B quit
5c2bded5
GM
114.br
115Close any open
116.B TELNET
117session and exit
24854a1c 118.IR telnet .
3c604e97 119An end of file (in command mode) will also close a session and exit.
24854a1c
KM
120.TP
121.B z
5c2bded5 122.br
24854a1c
KM
123Suspend
124.IR telnet .
125This command only works when the user is using the
126.IR csh (1).
127.TP
5c2bded5
GM
128.B mode \fItype\fP
129.br
130.I Type
131is either
132.I line
133(for \*(lqline by line\*(rq mode)
134or
135.I character
136(for \*(lqcharacter at a time\*(rq mode).
137The remote host is asked for permission to go into the requested mode.
138If the remote host is capable of entering that mode, the requested
139mode will be entered.
24854a1c
KM
140.TP
141.B status
5c2bded5 142.br
24854a1c
KM
143Show the current status of
144.IR telnet .
145This includes the peer one is connected to, as well
5c2bded5
GM
146as the current mode.
147.TP
148.B display \fR[\fP \fIargument...\fP \fR]\fP
149.br
150Displays all, or some, of the
151.B set
152and
153.B toggle
154values (see below).
155.TP
156.B ? \fR[\fP \fIcommand\fP \fR]\fP
157.br
24854a1c
KM
158Get help. With no arguments,
159.I telnet
160prints a help summary.
161If a command is specified,
162.I telnet
5c2bded5
GM
163will print the help information for just that command.
164.TP
165.B send \fIarguments\fP
166.br
167Sends one or more special character sequences to the remote host.
168The following are the arguments which may be specified
169(more than one argument may be specified at a time):
170.RS
171.TP
172.I escape
173.br
174Sends the current
175.I telnet
176escape character (initially \*(lq^]\*(rq).
177.TP
178.I synch
179.br
180Sends the
181.B TELNET SYNCH
182sequence.
183This sequence causes the remote system to discard all previously typed
184(but not yet read) input.
185This sequence is sent as TCP urgent
186data (and may not work if the remote system is a 4.2 BSD system -- if
187it doesn't work, a lower case \*(lqr\*(rq may be echoed on the terminal).
188.TP
189.I brk
190.br
191Sends the
192.B TELNET BRK
193(Break) sequence, which may have significance to the remote
194system.
195.TP
196.I ip
197.br
198Sends the
199.B TELNET IP
200(Interrupt Process) sequence, which hopefully will cause the remote
201system to abort the currently running process.
202.TP
203.I ao
204.br
205Sends the
206.B TELNET AO
207(Abort Output) sequence, which should cause the remote system to flush
208all output
209.B from
210the remote system
211.B to
212the user's terminal.
213.TP
214.I ayt
215.br
216Sends the
217.B TELNET AYT
218(Are You There)
219sequence, which the remote system may or may not choose to respond to.
220.TP
221.I ec
222.br
223Sends the
224.B TELNET EC
225(Erase Character)
226sequence, which should cause the remote system to erase the last character
227entered.
228.TP
229.I el
230.br
231Sends the
232.B TELNET EL
233(Erase Line)
234sequence, which should cause the remote system to erase the line currently
235being entered.
236.TP
237.I ga
238.br
239Sends the
240.B TELNET GA
241(Go Ahead)
242sequence, which likely has no significance to the remote system.
243.TP
244.I nop
245.br
246Sends the
247.B TELNET NOP
248(No OPeration)
249sequence.
250.TP
251.I ?
252.br
253Prints out help information for the
254.B send
255command.
256.RE
257.TP
258.B set \fIargument value\fP
259.br
260Set any one of a number of
261.I telnet
262variables to a specific value.
263The special value \*(lqoff\*(rq turns off the function associated with
264the variable.
265The variables which may be specified are:
266.RS
267.TP
268.I echo
269.br
270This is the value (initially \*(lq^E\*(rq) which, when in
271\*(lqline by line\*(rq mode, toggles between doing local echoing
272of entered characters (for normal processing), and suppressing
273echoing of entered characters (for entering, say, a password).
274.TP
275.I escape
276.br
277This is the
278.I telnet
279escape character (initially \*(lq^[\*(rq) which causes entry
280into
281.I telnet
282command mode (when connected to a remote system).
283.TP
284.I interrupt
285.br
286If
287.I telnet
288is in
289.I localchars
290mode (see
291.B toggle
292.I localchars
293below)
294and the
295.I interrupt
296character is typed, a
297.B TELNET IP
298sequence (see
299.B send
300.I ip
301above)
302is sent to the remote host.
303The initial value for the interrupt character is taken to be
304the terminal's
305.B intr
306character.
307.TP
308.I quit
309.br
310If
311.I telnet
312is in
313.I localchars
314mode (see
315.B toggle
316.I localchars
317below)
318and the
319.I quit
320character is typed, a
321.B TELNET BRK
322sequence (see
323.B send
324.I brk
325above)
326is sent to the remote host.
327The initial value for the quit character is taken to be
328the terminal's
329.B quit
330character.
331.TP
332.I flushoutput
333.br
334If
335.I telnet
336is in
337.I localchars
338mode (see
339.B toggle
340.I localchars
341below)
342and the
343.I flushoutput
344character is typed, a
345.B TELNET AO
346sequence (see
347.B send
348.I ao
349above)
350is sent to the remote host.
351The initial value for the flush character is taken to be
352the terminal's
353.B flush
354character.
355.TP
356.I erase
357.br
358If
359.I telnet
360is in
361.I localchars
362mode (see
363.B toggle
364.I localchars
365below),
366.B and
367if
368.I telnet
369is operating in \*(lqcharacter at a time\*(rq mode, then when this
370character is typed, a
371.B TELNET EC
372sequence (see
373.B send
374.I ec
375above)
376is sent to the remote system.
377The initial value for the erase character is taken to be
378the terminal's
379.B erase
380character.
381.TP
382.I kill
383.br
384If
385.I telnet
386is in
387.I localchars
388mode (see
389.B toggle
390.I localchars
391below),
392.B and
393if
394.I telnet
395is operating in \*(lqcharacter at a time\*(rq mode, then when this
396character is typed, a
397.B TELNET EL
398sequence (see
399.B send
400.I el
401above)
402is sent to the remote system.
403The initial value for the kill character is taken to be
404the terminal's
405.B kill
406character.
407.TP
408.I eof
409.br
410If
411.I telnet
412is operating in \*(lqline by line\*(rq mode, entering this character
413as the first character on a line will cause this character to be
414sent to the remote system.
415The initial value of the eof character is taken to be the terminal's
416.B eof
417character.
418.RE
419.TP
420.B toggle \fIarguments...\fP
421.br
422Toggle (between
423TRUE
424and
425FALSE)
426various flags that control how
427.I telnet
428responds to events.
429More than one argument may be specified.
430Valid arguments are:
431.RS
432.TP
433.I localchars
434.br
435If this is
436TRUE,
437then the
438.IR flush ,
439.IR interrupt ,
440.IR quit ,
441.IR erase ,
442and
443.I kill
444characters (see
445.B set
446above) are recognized locally, and transformed into (hopefully) appropriate
447.B TELNET
448control sequences
449(respectively
450.IR ao ,
451.IR ip ,
452.IR brk ,
453.IR ec ,
454and
455.IR el ;
456see
457.B send
458above).
459The initial value for this toggle is TRUE in \*(lqline by line\*(rq mode,
460and FALSE in \*(lqcharacter at a time\*(rq mode.
461.TP
462.I autosynch
463If
464.I autosynch
465and
466.I localsigs
467are both
468TRUE,
469then when either the
470.I intr
471or
472.I quit
473characters is typed (see
474.B set
475above for descriptions of the
476.I intr
477and
478.I quit
479characters), the resulting
480.B TELNET
481sequence sent is followed by the
482.B TELNET SYNCH
483sequence.
484This procedure
485.B should
486cause the remote system to begin throwing away all previously
487typed input until both of the
488.B TELNET
489sequences have been read and acted upon.
490The initial value of this toggle is FALSE.
491.TP
492.I autoflush
493.br
494If
495.I autoflush
496and
497.I localchars
498are both
499TRUE,
500then when the
501.IR ao ,
502.IR intr ,
503or
504.I quit
505characters are recognized (and transformed into
506.B TELNET
507sequences; see
508.B set
509above for details),
510.I telnet
511refuses to display any data on the user's terminal
512until the remote system acknowledges (via a
513.B TELNET
514.I Timing Mark
515option)
516that it has processed those
517.B TELNET
518sequences.
519The initial value for this toggle is TRUE if the terminal user had not
520done an "stty noflsh", otherwise FALSE (see
521.IR stty(1)).
522.TP
523.I crmod
524.br
525Toggle carriage return mode.
526When this mode is enabled, most carriage return characters received from
527the remote host will be mapped into a carriage return followed by
528a line feed.
529This mode does not affect those characters typed by the user, only
530those received from the remote host.
531This mode is not very useful unless the remote host
532only sends carriage return, but never line feed.
533The initial value for this toggle is FALSE.
534.TP
535.I debug
536.br
537Toggles socket level debugging (useful only to the
538.IR super user ).
539The initial value for this toggle is FALSE.
540.TP
541.I options
542.br
543Toggles the display of some internal
544.I telnet
545protocol processing (having to do with
546.B TELNET
547options).
548The initial value for this toggle is FALSE.
549.TP
550.I netdata
551.br
552Toggles the display of all network data (in hexadecimal format).
553The initial value for this toggle is FALSE.
554.TP
555.I ?
556.br
557Displays the legal
558.B toggle
559commands.
560.RE
24854a1c 561.SH BUGS
5c2bded5
GM
562.PP
563There is no adequate way for dealing with flow control.
564.PP
565On some remote systems, echo has to be turned off manually when in
566\*(lqline by line\*(rq mode.
567.PP
568There is enough settable state to justify a
569.RI . telnetrc
570file.
571.PP
572No capability for a
573.RI . telnetrc
574file is provided.
575.PP
576In \*(lqline by line\*(rq mode, the terminal's
577.I eof
578character is only recognized (and sent to the remote system)
579when it is the first character on a line.