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