]> git.saurik.com Git - apple/network_cmds.git/blame - telnet.tproj/telnet.1
network_cmds-176.tar.gz
[apple/network_cmds.git] / telnet.tproj / telnet.1
CommitLineData
b7080c8e
A
1.\" Copyright (c) 1983, 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)telnet.1 8.6 (Berkeley) 6/1/94
7ba0088d 33.\" $FreeBSD: src/crypto/telnet/telnet/telnet.1,v 1.4.2.9 2002/04/13 10:59:08 markm Exp $
b7080c8e 34.\"
7ba0088d 35.Dd January 27, 2000
b7080c8e 36.Dt TELNET 1
7ba0088d 37.Os
b7080c8e
A
38.Sh NAME
39.Nm telnet
7ba0088d 40.Nd user interface to the
b7080c8e
A
41.Tn TELNET
42protocol
43.Sh SYNOPSIS
7ba0088d
A
44.Nm
45.Op Fl 468EFKLNacdfruxy
b7080c8e
A
46.Op Fl S Ar tos
47.Op Fl X Ar authtype
48.Op Fl e Ar escapechar
49.Op Fl k Ar realm
50.Op Fl l Ar user
51.Op Fl n Ar tracefile
7ba0088d 52.Op Fl s Ar src_addr
b7080c8e
A
53.Oo
54.Ar host
7ba0088d 55.Op Ar port
b7080c8e
A
56.Oc
57.Sh DESCRIPTION
58The
7ba0088d 59.Nm
b7080c8e 60command
7ba0088d 61is used to communicate with another host using the
b7080c8e
A
62.Tn TELNET
63protocol.
64If
7ba0088d 65.Nm
b7080c8e
A
66is invoked without the
67.Ar host
68argument, it enters command mode,
69indicated by its prompt
7ba0088d 70.Pq Dq Li telnet\&> .
b7080c8e
A
71In this mode, it accepts and executes the commands listed below.
72If it is invoked with arguments, it performs an
73.Ic open
74command with those arguments.
75.Pp
76Options:
77.Bl -tag -width indent
7ba0088d
A
78.It Fl 4
79Forces
80.Nm
81to use IPv4 addresses only.
82.It Fl 6
83Forces
84.Nm
85to use IPv6 addresses only.
b7080c8e
A
86.It Fl 8
87Specifies an 8-bit data path. This causes an attempt to
88negotiate the
89.Dv TELNET BINARY
90option on both input and output.
91.It Fl E
92Stops any character from being recognized as an escape character.
93.It Fl F
94If Kerberos V5 authentication is being used, the
95.Fl F
96option allows the local credentials to be forwarded
97to the remote system, including any credentials that
98have already been forwarded into the local environment.
99.It Fl K
100Specifies no automatic login to the remote system.
101.It Fl L
102Specifies an 8-bit data path on output. This causes the
7ba0088d
A
103.Dv BINARY
104option to be negotiated on output.
105.It Fl N
106Prevents IP address to name lookup when destination host is given
107as an IP address.
b7080c8e
A
108.It Fl S Ar tos
109Sets the IP type-of-service (TOS) option for the telnet
110connection to the value
7ba0088d 111.Ar tos ,
b7080c8e
A
112which can be a numeric TOS value
113or, on systems that support it, a symbolic
7ba0088d
A
114TOS name found in the
115.Pa /etc/iptos
116file.
117.It Fl X Ar atype
b7080c8e
A
118Disables the
119.Ar atype
120type of authentication.
121.It Fl a
122Attempt automatic login.
7ba0088d 123This is now the default, so this option is ignored.
b7080c8e
A
124Currently, this sends the user name via the
125.Ev USER
126variable
127of the
128.Ev ENVIRON
129option if supported by the remote system.
130The name used is that of the current user as returned by
131.Xr getlogin 2
132if it agrees with the current user ID,
133otherwise it is the name associated with the user ID.
134.It Fl c
135Disables the reading of the user's
136.Pa \&.telnetrc
137file. (See the
138.Ic toggle skiprc
139command on this man page.)
140.It Fl d
141Sets the initial value of the
142.Ic debug
143toggle to
7ba0088d
A
144.Dv TRUE .
145.It Fl e Ar escapechar
b7080c8e
A
146Sets the initial
147.Nm
b7080c8e 148escape character to
7ba0088d 149.Ar escapechar .
b7080c8e 150If
7ba0088d 151.Ar escapechar
b7080c8e
A
152is omitted, then
153there will be no escape character.
154.It Fl f
155If Kerberos V5 authentication is being used, the
156.Fl f
157option allows the local credentials to be forwarded to the remote system.
b7080c8e
A
158.It Fl k Ar realm
159If Kerberos authentication is being used, the
160.Fl k
7ba0088d
A
161option requests that
162.Nm
163obtain tickets for the remote host in
164realm
165.Ar realm
166instead of the remote host's realm, as determined by
b7080c8e 167.Xr krb_realmofhost 3 .
7ba0088d 168.It Fl l Ar user
b7080c8e
A
169When connecting to the remote system, if the remote system
170understands the
171.Ev ENVIRON
172option, then
173.Ar user
7ba0088d
A
174will be sent to the remote system as the value for the variable
175.Ev USER .
b7080c8e
A
176This option implies the
177.Fl a
178option.
179This option may also be used with the
180.Ic open
181command.
7ba0088d 182.It Fl n Ar tracefile
b7080c8e
A
183Opens
184.Ar tracefile
185for recording trace information.
186See the
187.Ic set tracefile
188command below.
189.It Fl r
190Specifies a user interface similar to
191.Xr rlogin 1 .
192In this
193mode, the escape character is set to the tilde (~) character,
7ba0088d
A
194unless modified by the
195.Fl e
196option.
197.It Fl s Ar src_addr
198Set the source IP address for the
199.Nm
200connection to
201.Ar src_addr ,
202which can be an IP address or a host name.
203.It Fl u
204Forces
205.Nm
206to use
207.Dv AF_UNIX
208addresses only (e.g.,
209.Ux
210domain sockets, accessed with a file path).
b7080c8e 211.It Fl x
7ba0088d
A
212Turns on encryption of the data stream if possible.
213This is now the default, so this option is ignored.
214.It Fl y
215Suppresses encryption of the data stream.
b7080c8e
A
216.It Ar host
217Indicates the official name, an alias, or the Internet address
218of a remote host.
7ba0088d
A
219If
220.Ar host
221starts with a
222.Ql / ,
223.Nm
224establishes a connection to the corresponding named socket.
b7080c8e
A
225.It Ar port
226Indicates a port number (address of an application). If a number is
227not specified, the default
7ba0088d 228.Nm
b7080c8e
A
229port is used.
230.El
231.Pp
232When in rlogin mode, a line of the form ~. disconnects from the
7ba0088d
A
233remote host; ~ is the
234.Nm
235escape character.
236Similarly, the line ~^Z suspends the
237.Nm
238session.
239The line ~^] escapes to the normal
240.Nm
241escape prompt.
b7080c8e
A
242.Pp
243Once a connection has been opened,
7ba0088d 244.Nm
b7080c8e
A
245will attempt to enable the
246.Dv TELNET LINEMODE
247option.
248If this fails, then
7ba0088d 249.Nm
b7080c8e
A
250will revert to one of two input modes:
251either \*(Lqcharacter at a time\*(Rq
252or \*(Lqold line by line\*(Rq
253depending on what the remote system supports.
254.Pp
7ba0088d 255When
b7080c8e
A
256.Dv LINEMODE
257is enabled, character processing is done on the
258local system, under the control of the remote system. When input
259editing or character echoing is to be disabled, the remote system
260will relay that information. The remote system will also relay
261changes to any special characters that happen on the remote
262system, so that they can take effect on the local system.
263.Pp
264In \*(Lqcharacter at a time\*(Rq mode, most
265text typed is immediately sent to the remote host for processing.
266.Pp
267In \*(Lqold line by line\*(Rq mode, all text is echoed locally,
268and (normally) only completed lines are sent to the remote host.
269The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used
270to turn off and on the local echo
271(this would mostly be used to enter passwords
272without the password being echoed).
273.Pp
7ba0088d 274If the
b7080c8e
A
275.Dv LINEMODE
276option is enabled, or if the
277.Ic localchars
278toggle is
279.Dv TRUE
7ba0088d 280(the default for \*(Lqold line by line\*(Rq; see below),
b7080c8e
A
281the user's
282.Ic quit ,
283.Ic intr ,
284and
285.Ic flush
286characters are trapped locally, and sent as
287.Tn TELNET
288protocol sequences to the remote side.
7ba0088d 289If
b7080c8e
A
290.Dv LINEMODE
291has ever been enabled, then the user's
292.Ic susp
293and
294.Ic eof
295are also sent as
296.Tn TELNET
297protocol sequences,
298and
299.Ic quit
7ba0088d 300is sent as a
b7080c8e 301.Dv TELNET ABORT
7ba0088d
A
302instead of
303.Dv BREAK .
b7080c8e
A
304There are options (see
305.Ic toggle
306.Ic autoflush
307and
308.Ic toggle
309.Ic autosynch
310below)
311which cause this action to flush subsequent output to the terminal
312(until the remote host acknowledges the
313.Tn TELNET
314sequence) and flush previous terminal input
315(in the case of
316.Ic quit
317and
318.Ic intr ) .
319.Pp
320While connected to a remote host,
7ba0088d 321.Nm
b7080c8e 322command mode may be entered by typing the
7ba0088d 323.Nm
b7080c8e
A
324\*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq).
325When in command mode, the normal terminal editing conventions are available.
326.Pp
327The following
7ba0088d 328.Nm
b7080c8e
A
329commands are available.
330Only enough of each command to uniquely identify it need be typed
331(this is also true for arguments to the
332.Ic mode ,
333.Ic set ,
334.Ic toggle ,
335.Ic unset ,
336.Ic slc ,
337.Ic environ ,
338and
339.Ic display
340commands).
341.Pp
342.Bl -tag -width "mode type"
7ba0088d 343.It Ic auth Ar argument ...
b7080c8e
A
344The auth command manipulates the information sent through the
345.Dv TELNET AUTHENTICATE
346option. Valid arguments for the
7ba0088d
A
347.Ic auth
348command are:
b7080c8e
A
349.Bl -tag -width "disable type"
350.It Ic disable Ar type
351Disables the specified type of authentication. To
352obtain a list of available types, use the
7ba0088d 353.Ic auth disable ?\&
b7080c8e
A
354command.
355.It Ic enable Ar type
356Enables the specified type of authentication. To
357obtain a list of available types, use the
7ba0088d 358.Ic auth enable ?\&
b7080c8e
A
359command.
360.It Ic status
361Lists the current status of the various types of
362authentication.
363.El
364.It Ic close
365Close a
366.Tn TELNET
367session and return to command mode.
7ba0088d 368.It Ic display Ar argument ...
b7080c8e
A
369Displays all, or some, of the
370.Ic set
371and
372.Ic toggle
373values (see below).
374.It Ic encrypt Ar argument ...
375The encrypt command manipulates the information sent through the
376.Dv TELNET ENCRYPT
377option.
378.Pp
7ba0088d
A
379Valid arguments for the
380.Ic encrypt
381command are:
b7080c8e 382.Bl -tag -width Ar
7ba0088d
A
383.It Ic disable Ar type Xo
384.Op Cm input | output
385.Xc
b7080c8e
A
386Disables the specified type of encryption. If you
387omit the input and output, both input and output
388are disabled. To obtain a list of available
389types, use the
7ba0088d 390.Ic encrypt disable ?\&
b7080c8e 391command.
7ba0088d
A
392.It Ic enable Ar type Xo
393.Op Cm input | output
394.Xc
b7080c8e
A
395Enables the specified type of encryption. If you
396omit input and output, both input and output are
397enabled. To obtain a list of available types, use the
7ba0088d 398.Ic encrypt enable ?\&
b7080c8e
A
399command.
400.It Ic input
401This is the same as the
402.Ic encrypt start input
403command.
404.It Ic -input
405This is the same as the
406.Ic encrypt stop input
407command.
408.It Ic output
409This is the same as the
410.Ic encrypt start output
411command.
412.It Ic -output
413This is the same as the
414.Ic encrypt stop output
415command.
7ba0088d 416.It Ic start Op Cm input | output
b7080c8e
A
417Attempts to start encryption. If you omit
418.Ic input
419and
7ba0088d 420.Ic output ,
b7080c8e
A
421both input and output are enabled. To
422obtain a list of available types, use the
7ba0088d 423.Ic encrypt enable ?\&
b7080c8e
A
424command.
425.It Ic status
426Lists the current status of encryption.
7ba0088d 427.It Ic stop Op Cm input | output
b7080c8e
A
428Stops encryption. If you omit input and output,
429encryption is on both input and output.
430.It Ic type Ar type
431Sets the default type of encryption to be used
432with later
433.Ic encrypt start
434or
435.Ic encrypt stop
436commands.
437.El
7ba0088d 438.It Ic environ Ar arguments ...
b7080c8e
A
439The
440.Ic environ
441command is used to manipulate the
7ba0088d 442variables that may be sent through the
b7080c8e
A
443.Dv TELNET ENVIRON
444option.
445The initial set of variables is taken from the users
446environment, with only the
447.Ev DISPLAY
448and
449.Ev PRINTER
450variables being exported by default.
451The
452.Ev USER
453variable is also exported if the
454.Fl a
455or
456.Fl l
457options are used.
7ba0088d 458.Pp
b7080c8e
A
459Valid arguments for the
460.Ic environ
461command are:
462.Bl -tag -width Fl
7ba0088d 463.It Ic define Ar variable value
b7080c8e
A
464Define the variable
465.Ar variable
466to have a value of
7ba0088d 467.Ar value .
b7080c8e
A
468Any variables defined by this command are automatically exported.
469The
470.Ar value
471may be enclosed in single or double quotes so
472that tabs and spaces may be included.
7ba0088d 473.It Ic undefine Ar variable
b7080c8e
A
474Remove
475.Ar variable
476from the list of environment variables.
7ba0088d 477.It Ic export Ar variable
b7080c8e
A
478Mark the variable
479.Ar variable
480to be exported to the remote side.
7ba0088d 481.It Ic unexport Ar variable
b7080c8e
A
482Mark the variable
483.Ar variable
484to not be exported unless
485explicitly asked for by the remote side.
486.It Ic list
487List the current set of environment variables.
488Those marked with a
489.Cm *
490will be sent automatically,
491other variables will only be sent if explicitly requested.
7ba0088d 492.It Ic ?\&
b7080c8e
A
493Prints out help information for the
494.Ic environ
495command.
496.El
497.It Ic logout
498Sends the
499.Dv TELNET LOGOUT
500option to the remote side.
501This command is similar to a
502.Ic close
503command; however, if the remote side does not support the
504.Dv LOGOUT
505option, nothing happens.
506If, however, the remote side does support the
507.Dv LOGOUT
508option, this command should cause the remote side to close the
509.Tn TELNET
510connection.
511If the remote side also supports the concept of
512suspending a user's session for later reattachment,
513the logout argument indicates that you
514should terminate the session immediately.
7ba0088d 515.It Ic mode Ar type
b7080c8e
A
516.Ar Type
517is one of several options, depending on the state of the
518.Tn TELNET
519session.
520The remote host is asked for permission to go into the requested mode.
521If the remote host is capable of entering that mode, the requested
522mode will be entered.
523.Bl -tag -width Ar
524.It Ic character
525Disable the
526.Dv TELNET LINEMODE
527option, or, if the remote side does not understand the
528.Dv LINEMODE
7ba0088d 529option, then enter \*(Lqcharacter at a time\*(Rq mode.
b7080c8e
A
530.It Ic line
531Enable the
532.Dv TELNET LINEMODE
533option, or, if the remote side does not understand the
534.Dv LINEMODE
7ba0088d
A
535option, then attempt to enter \*(Lqold-line-by-line\*(Rq mode.
536.It Ic isig Pq Ic \-isig
537Attempt to enable (disable) the
b7080c8e 538.Dv TRAPSIG
7ba0088d 539mode of the
b7080c8e
A
540.Dv LINEMODE
541option.
7ba0088d 542This requires that the
b7080c8e
A
543.Dv LINEMODE
544option be enabled.
7ba0088d
A
545.It Ic edit Pq Ic \-edit
546Attempt to enable (disable) the
b7080c8e 547.Dv EDIT
7ba0088d 548mode of the
b7080c8e
A
549.Dv LINEMODE
550option.
7ba0088d 551This requires that the
b7080c8e
A
552.Dv LINEMODE
553option be enabled.
7ba0088d
A
554.It Ic softtabs Pq Ic \-softtabs
555Attempt to enable (disable) the
b7080c8e 556.Dv SOFT_TAB
7ba0088d 557mode of the
b7080c8e
A
558.Dv LINEMODE
559option.
7ba0088d 560This requires that the
b7080c8e
A
561.Dv LINEMODE
562option be enabled.
7ba0088d
A
563.It Ic litecho Pq Ic \-litecho
564Attempt to enable (disable) the
b7080c8e 565.Dv LIT_ECHO
7ba0088d 566mode of the
b7080c8e
A
567.Dv LINEMODE
568option.
7ba0088d 569This requires that the
b7080c8e
A
570.Dv LINEMODE
571option be enabled.
7ba0088d 572.It Ic ?\&
b7080c8e
A
573Prints out help information for the
574.Ic mode
575command.
576.El
577.It Xo
578.Ic open Ar host
7ba0088d
A
579.Op Fl l Ar user
580.Op Oo Fl Oc Ns Ar port
b7080c8e
A
581.Xc
582Open a connection to the named host.
583If no port number
584is specified,
7ba0088d 585.Nm
b7080c8e
A
586will attempt to contact a
587.Tn TELNET
588server at the default port.
589The host specification may be either a host name (see
7ba0088d
A
590.Xr hosts 5 ) ,
591an Internet address specified in the \*(Lqdot notation\*(Rq (see
592.Xr inet 3 ) ,
593or IPv6 host name or IPv6 coloned-hexadecimal addreess.
b7080c8e 594The
7ba0088d 595.Fl l
b7080c8e
A
596option may be used to specify the user name
597to be passed to the remote system via the
598.Ev ENVIRON
599option.
600When connecting to a non-standard port,
7ba0088d 601.Nm
b7080c8e
A
602omits any automatic initiation of
603.Tn TELNET
604options. When the port number is preceded by a minus sign,
605the initial option negotiation is done.
606After establishing a connection, the file
607.Pa \&.telnetrc
608in the
609users home directory is opened. Lines beginning with a # are
610comment lines. Blank lines are ignored. Lines that begin
611without white space are the start of a machine entry. The
612first thing on the line is the name of the machine that is
613being connected to. The rest of the line, and successive
614lines that begin with white space are assumed to be
7ba0088d 615.Nm
b7080c8e
A
616commands and are processed as if they had been typed
617in manually to the
7ba0088d 618.Nm
b7080c8e
A
619command prompt.
620.It Ic quit
621Close any open
622.Tn TELNET
623session and exit
7ba0088d 624.Nm .
b7080c8e 625An end of file (in command mode) will also close a session and exit.
7ba0088d 626.It Ic send Ar arguments
b7080c8e
A
627Sends one or more special character sequences to the remote host.
628The following are the arguments which may be specified
629(more than one argument may be specified at a time):
630.Pp
631.Bl -tag -width escape
632.It Ic abort
633Sends the
634.Dv TELNET ABORT
635(Abort
636processes)
637sequence.
638.It Ic ao
639Sends the
640.Dv TELNET AO
641(Abort Output) sequence, which should cause the remote system to flush
642all output
643.Em from
644the remote system
645.Em to
646the user's terminal.
647.It Ic ayt
648Sends the
649.Dv TELNET AYT
650(Are You There)
651sequence, to which the remote system may or may not choose to respond.
652.It Ic brk
653Sends the
654.Dv TELNET BRK
655(Break) sequence, which may have significance to the remote
656system.
657.It Ic ec
658Sends the
659.Dv TELNET EC
660(Erase Character)
661sequence, which should cause the remote system to erase the last character
662entered.
663.It Ic el
664Sends the
665.Dv TELNET EL
666(Erase Line)
667sequence, which should cause the remote system to erase the line currently
668being entered.
669.It Ic eof
670Sends the
671.Dv TELNET EOF
672(End Of File)
673sequence.
674.It Ic eor
675Sends the
676.Dv TELNET EOR
677(End of Record)
678sequence.
679.It Ic escape
680Sends the current
7ba0088d 681.Nm
b7080c8e
A
682escape character (initially \*(Lq^\*(Rq).
683.It Ic ga
684Sends the
685.Dv TELNET GA
686(Go Ahead)
687sequence, which likely has no significance to the remote system.
688.It Ic getstatus
689If the remote side supports the
690.Dv TELNET STATUS
691command,
692.Ic getstatus
693will send the subnegotiation to request that the server send
694its current option status.
b7080c8e
A
695.It Ic ip
696Sends the
697.Dv TELNET IP
698(Interrupt Process) sequence, which should cause the remote
699system to abort the currently running process.
700.It Ic nop
701Sends the
702.Dv TELNET NOP
703(No OPeration)
704sequence.
705.It Ic susp
706Sends the
707.Dv TELNET SUSP
708(SUSPend process)
709sequence.
710.It Ic synch
711Sends the
712.Dv TELNET SYNCH
713sequence.
714This sequence causes the remote system to discard all previously typed
715(but not yet read) input.
716This sequence is sent as
717.Tn TCP
718urgent
719data (and may not work if the remote system is a
720.Bx 4.2
721system -- if
722it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
723.It Ic do Ar cmd
724.It Ic dont Ar cmd
725.It Ic will Ar cmd
726.It Ic wont Ar cmd
727Sends the
728.Dv TELNET DO
729.Ar cmd
730sequence.
731.Ar Cmd
732can be either a decimal number between 0 and 255,
733or a symbolic name for a specific
734.Dv TELNET
735command.
736.Ar Cmd
737can also be either
738.Ic help
739or
7ba0088d 740.Ic ?\&
b7080c8e
A
741to print out help information, including
742a list of known symbolic names.
7ba0088d 743.It Ic ?\&
b7080c8e
A
744Prints out help information for the
745.Ic send
746command.
747.El
7ba0088d
A
748.It Ic set Ar argument value
749.It Ic unset Ar argument value
b7080c8e
A
750The
751.Ic set
752command will set any one of a number of
7ba0088d 753.Nm
b7080c8e
A
754variables to a specific value or to
755.Dv TRUE .
756The special value
757.Ic off
758turns off the function associated with
759the variable, this is equivalent to using the
760.Ic unset
761command.
762The
763.Ic unset
764command will disable or set to
765.Dv FALSE
766any of the specified functions.
767The values of variables may be interrogated with the
768.Ic display
769command.
770The variables which may be set or unset, but not toggled, are
771listed here. In addition, any of the variables for the
772.Ic toggle
773command may be explicitly set or unset using
774the
775.Ic set
776and
777.Ic unset
778commands.
779.Bl -tag -width escape
780.It Ic ayt
781If
782.Tn TELNET
783is in localchars mode, or
784.Dv LINEMODE
785is enabled, and the status character is typed, a
786.Dv TELNET AYT
787sequence (see
788.Ic send ayt
789preceding) is sent to the
7ba0088d 790remote host. The initial value for the \*(LqAre You There\*(Rq
b7080c8e
A
791character is the terminal's status character.
792.It Ic echo
793This is the value (initially \*(Lq^E\*(Rq) which, when in
794\*(Lqline by line\*(Rq mode, toggles between doing local echoing
795of entered characters (for normal processing), and suppressing
796echoing of entered characters (for entering, say, a password).
797.It Ic eof
798If
7ba0088d 799.Nm
b7080c8e
A
800is operating in
801.Dv LINEMODE
802or \*(Lqold line by line\*(Rq mode, entering this character
803as the first character on a line will cause this character to be
804sent to the remote system.
805The initial value of the eof character is taken to be the terminal's
806.Ic eof
807character.
808.It Ic erase
809If
7ba0088d 810.Nm
b7080c8e
A
811is in
812.Ic localchars
813mode (see
814.Ic toggle
815.Ic localchars
816below),
817.Sy and
818if
7ba0088d 819.Nm
b7080c8e
A
820is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
821character is typed, a
822.Dv TELNET EC
823sequence (see
824.Ic send
825.Ic ec
826above)
827is sent to the remote system.
828The initial value for the erase character is taken to be
829the terminal's
830.Ic erase
831character.
832.It Ic escape
833This is the
7ba0088d 834.Nm
b7080c8e
A
835escape character (initially \*(Lq^[\*(Rq) which causes entry
836into
7ba0088d 837.Nm
b7080c8e
A
838command mode (when connected to a remote system).
839.It Ic flushoutput
840If
7ba0088d 841.Nm
b7080c8e
A
842is in
843.Ic localchars
844mode (see
845.Ic toggle
846.Ic localchars
847below)
848and the
849.Ic flushoutput
850character is typed, a
851.Dv TELNET AO
852sequence (see
853.Ic send
854.Ic ao
855above)
856is sent to the remote host.
857The initial value for the flush character is taken to be
858the terminal's
859.Ic flush
860character.
861.It Ic forw1
862.It Ic forw2
863If
7ba0088d 864.Nm
b7080c8e
A
865is operating in
866.Dv LINEMODE ,
867these are the
868characters that, when typed, cause partial lines to be
869forwarded to the remote system. The initial value for
870the forwarding characters are taken from the terminal's
871eol and eol2 characters.
872.It Ic interrupt
873If
7ba0088d 874.Nm
b7080c8e
A
875is in
876.Ic localchars
877mode (see
878.Ic toggle
879.Ic localchars
880below)
881and the
882.Ic interrupt
883character is typed, a
884.Dv TELNET IP
885sequence (see
886.Ic send
887.Ic ip
888above)
889is sent to the remote host.
890The initial value for the interrupt character is taken to be
891the terminal's
892.Ic intr
893character.
894.It Ic kill
895If
7ba0088d 896.Nm
b7080c8e
A
897is in
898.Ic localchars
899mode (see
900.Ic toggle
901.Ic localchars
902below),
903.Ic and
904if
7ba0088d 905.Nm
b7080c8e
A
906is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
907character is typed, a
908.Dv TELNET EL
909sequence (see
910.Ic send
911.Ic el
912above)
913is sent to the remote system.
914The initial value for the kill character is taken to be
915the terminal's
916.Ic kill
917character.
918.It Ic lnext
919If
7ba0088d 920.Nm
b7080c8e
A
921is operating in
922.Dv LINEMODE
7ba0088d 923or \*(Lqold line by line\*(Rq mode, then this character is taken to
b7080c8e
A
924be the terminal's
925.Ic lnext
926character.
927The initial value for the lnext character is taken to be
928the terminal's
929.Ic lnext
930character.
931.It Ic quit
932If
7ba0088d 933.Nm
b7080c8e
A
934is in
935.Ic localchars
936mode (see
937.Ic toggle
938.Ic localchars
939below)
940and the
941.Ic quit
942character is typed, a
943.Dv TELNET BRK
944sequence (see
945.Ic send
946.Ic brk
947above)
948is sent to the remote host.
949The initial value for the quit character is taken to be
950the terminal's
951.Ic quit
952character.
953.It Ic reprint
954If
7ba0088d 955.Nm
b7080c8e
A
956is operating in
957.Dv LINEMODE
7ba0088d 958or \*(Lqold line by line\*(Rq mode, then this character is taken to
b7080c8e
A
959be the terminal's
960.Ic reprint
961character.
962The initial value for the reprint character is taken to be
963the terminal's
964.Ic reprint
965character.
966.It Ic rlogin
967This is the rlogin escape character.
968If set, the normal
7ba0088d 969.Nm
b7080c8e
A
970escape character is ignored unless it is
971preceded by this character at the beginning of a line.
972This character, at the beginning of a line followed by
973a "." closes the connection; when followed by a ^Z it
7ba0088d
A
974suspends the
975.Nm
976command. The initial state is to
977disable the
978.Nm rlogin
979escape character.
b7080c8e
A
980.It Ic start
981If the
982.Dv TELNET TOGGLE-FLOW-CONTROL
983option has been enabled,
984then this character is taken to
985be the terminal's
986.Ic start
987character.
7ba0088d 988The initial value for the start character is taken to be
b7080c8e
A
989the terminal's
990.Ic start
991character.
992.It Ic stop
993If the
994.Dv TELNET TOGGLE-FLOW-CONTROL
995option has been enabled,
996then this character is taken to
997be the terminal's
998.Ic stop
999character.
7ba0088d 1000The initial value for the stop character is taken to be
b7080c8e
A
1001the terminal's
1002.Ic stop
1003character.
1004.It Ic susp
1005If
7ba0088d 1006.Nm
b7080c8e
A
1007is in
1008.Ic localchars
1009mode, or
1010.Dv LINEMODE
1011is enabled, and the
1012.Ic suspend
1013character is typed, a
1014.Dv TELNET SUSP
1015sequence (see
1016.Ic send
1017.Ic susp
1018above)
1019is sent to the remote host.
1020The initial value for the suspend character is taken to be
1021the terminal's
1022.Ic suspend
1023character.
b7080c8e
A
1024.It Ic tracefile
1025This is the file to which the output, caused by
1026.Ic netdata
1027or
1028.Ic option
1029tracing being
1030.Dv TRUE ,
1031will be written. If it is set to
1032.Dq Fl ,
1033then tracing information will be written to standard output (the default).
1034.It Ic worderase
1035If
7ba0088d 1036.Nm
b7080c8e
A
1037is operating in
1038.Dv LINEMODE
7ba0088d 1039or \*(Lqold line by line\*(Rq mode, then this character is taken to
b7080c8e
A
1040be the terminal's
1041.Ic worderase
1042character.
1043The initial value for the worderase character is taken to be
1044the terminal's
1045.Ic worderase
1046character.
7ba0088d 1047.It Ic ?\&
b7080c8e
A
1048Displays the legal
1049.Ic set
1050.Pq Ic unset
1051commands.
1052.El
7ba0088d
A
1053.It Ic opie Ar sequence challenge
1054The
1055.Ic opie
1056command computes a response to the OPIE challenge.
1057.It Ic slc Ar state
b7080c8e
A
1058The
1059.Ic slc
1060command (Set Local Characters) is used to set
7ba0088d
A
1061or change the state of the special
1062characters when the
b7080c8e
A
1063.Dv TELNET LINEMODE
1064option has
1065been enabled. Special characters are characters that get
7ba0088d 1066mapped to
b7080c8e
A
1067.Tn TELNET
1068commands sequences (like
1069.Ic ip
1070or
1071.Ic quit )
1072or line editing characters (like
1073.Ic erase
1074and
1075.Ic kill ) .
1076By default, the local special characters are exported.
1077.Bl -tag -width Fl
1078.It Ic check
1079Verify the current settings for the current special characters.
1080The remote side is requested to send all the current special
1081character settings, and if there are any discrepancies with
1082the local side, the local side will switch to the remote value.
1083.It Ic export
1084Switch to the local defaults for the special characters. The
1085local default characters are those of the local terminal at
1086the time when
7ba0088d 1087.Nm
b7080c8e
A
1088was started.
1089.It Ic import
1090Switch to the remote defaults for the special characters.
1091The remote default characters are those of the remote system
7ba0088d 1092at the time when the
b7080c8e
A
1093.Tn TELNET
1094connection was established.
7ba0088d 1095.It Ic ?\&
b7080c8e
A
1096Prints out help information for the
1097.Ic slc
1098command.
1099.El
1100.It Ic status
1101Show the current status of
7ba0088d 1102.Nm .
b7080c8e
A
1103This includes the peer one is connected to, as well
1104as the current mode.
7ba0088d 1105.It Ic toggle Ar arguments ...
b7080c8e
A
1106Toggle (between
1107.Dv TRUE
1108and
1109.Dv FALSE )
1110various flags that control how
7ba0088d 1111.Nm
b7080c8e
A
1112responds to events.
1113These flags may be set explicitly to
1114.Dv TRUE
1115or
1116.Dv FALSE
1117using the
1118.Ic set
1119and
1120.Ic unset
1121commands listed above.
1122More than one argument may be specified.
1123The state of these flags may be interrogated with the
1124.Ic display
1125command.
1126Valid arguments are:
1127.Bl -tag -width Ar
1128.It Ic authdebug
1129Turns on debugging information for the authentication code.
1130.It Ic autoflush
1131If
1132.Ic autoflush
1133and
1134.Ic localchars
1135are both
1136.Dv TRUE ,
1137then when the
1138.Ic ao ,
1139or
1140.Ic quit
1141characters are recognized (and transformed into
1142.Tn TELNET
1143sequences; see
1144.Ic set
1145above for details),
7ba0088d 1146.Nm
b7080c8e
A
1147refuses to display any data on the user's terminal
1148until the remote system acknowledges (via a
1149.Dv TELNET TIMING MARK
1150option)
1151that it has processed those
1152.Tn TELNET
1153sequences.
1154The initial value for this toggle is
1155.Dv TRUE
1156if the terminal user had not
1157done an "stty noflsh", otherwise
1158.Dv FALSE
1159(see
1160.Xr stty 1 ) .
1161.It Ic autodecrypt
1162When the
1163.Dv TELNET ENCRYPT
1164option is negotiated, by
1165default the actual encryption (decryption) of the data
1166stream does not start automatically. The autoencrypt
1167(autodecrypt) command states that encryption of the
1168output (input) stream should be enabled as soon as
1169possible.
b7080c8e
A
1170.It Ic autologin
1171If the remote side supports the
1172.Dv TELNET AUTHENTICATION
1173option
7ba0088d 1174.Nm
b7080c8e
A
1175attempts to use it to perform automatic authentication. If the
1176.Dv AUTHENTICATION
1177option is not supported, the user's login
1178name are propagated through the
1179.Dv TELNET ENVIRON
1180option.
1181This command is the same as specifying
7ba0088d 1182.Fl a
b7080c8e
A
1183option on the
1184.Ic open
1185command.
1186.It Ic autosynch
1187If
1188.Ic autosynch
1189and
1190.Ic localchars
1191are both
1192.Dv TRUE ,
1193then when either the
1194.Ic intr
1195or
1196.Ic quit
1197characters is typed (see
1198.Ic set
1199above for descriptions of the
1200.Ic intr
1201and
1202.Ic quit
1203characters), the resulting
1204.Tn TELNET
1205sequence sent is followed by the
1206.Dv TELNET SYNCH
1207sequence.
1208This procedure
1209.Ic should
1210cause the remote system to begin throwing away all previously
1211typed input until both of the
1212.Tn TELNET
1213sequences have been read and acted upon.
1214The initial value of this toggle is
1215.Dv FALSE .
1216.It Ic binary
1217Enable or disable the
1218.Dv TELNET BINARY
1219option on both input and output.
1220.It Ic inbinary
1221Enable or disable the
1222.Dv TELNET BINARY
1223option on input.
1224.It Ic outbinary
1225Enable or disable the
1226.Dv TELNET BINARY
1227option on output.
1228.It Ic crlf
1229If this is
1230.Dv TRUE ,
1231then carriage returns will be sent as
1232.Li <CR><LF> .
1233If this is
1234.Dv FALSE ,
1235then carriage returns will be send as
1236.Li <CR><NUL> .
1237The initial value for this toggle is
1238.Dv FALSE .
1239.It Ic crmod
1240Toggle carriage return mode.
1241When this mode is enabled, most carriage return characters received from
1242the remote host will be mapped into a carriage return followed by
1243a line feed.
1244This mode does not affect those characters typed by the user, only
1245those received from the remote host.
1246This mode is not very useful unless the remote host
1247only sends carriage return, but never line feed.
1248The initial value for this toggle is
1249.Dv FALSE .
1250.It Ic debug
1251Toggles socket level debugging (useful only to the
1252.Ic super user ) .
1253The initial value for this toggle is
1254.Dv FALSE .
1255.It Ic encdebug
1256Turns on debugging information for the encryption code.
1257.It Ic localchars
1258If this is
1259.Dv TRUE ,
1260then the
1261.Ic flush ,
1262.Ic interrupt ,
1263.Ic quit ,
1264.Ic erase ,
1265and
1266.Ic kill
1267characters (see
1268.Ic set
1269above) are recognized locally, and transformed into (hopefully) appropriate
1270.Tn TELNET
1271control sequences
1272(respectively
1273.Ic ao ,
1274.Ic ip ,
1275.Ic brk ,
1276.Ic ec ,
1277and
1278.Ic el ;
1279see
1280.Ic send
1281above).
1282The initial value for this toggle is
1283.Dv TRUE
1284in \*(Lqold line by line\*(Rq mode,
1285and
1286.Dv FALSE
1287in \*(Lqcharacter at a time\*(Rq mode.
1288When the
1289.Dv LINEMODE
1290option is enabled, the value of
1291.Ic localchars
1292is ignored, and assumed to always be
1293.Dv TRUE .
1294If
1295.Dv LINEMODE
1296has ever been enabled, then
1297.Ic quit
1298is sent as
1299.Ic abort ,
1300and
7ba0088d
A
1301.Ic eof
1302and
1303.Ic suspend
b7080c8e 1304are sent as
7ba0088d
A
1305.Ic eof
1306and
1307.Ic susp
1308(see
b7080c8e
A
1309.Ic send
1310above).
1311.It Ic netdata
1312Toggles the display of all network data (in hexadecimal format).
1313The initial value for this toggle is
1314.Dv FALSE .
1315.It Ic options
1316Toggles the display of some internal
7ba0088d 1317.Nm
b7080c8e
A
1318protocol processing (having to do with
1319.Tn TELNET
1320options).
1321The initial value for this toggle is
1322.Dv FALSE .
b7080c8e
A
1323.It Ic prettydump
1324When the
1325.Ic netdata
1326toggle is enabled, if
1327.Ic prettydump
1328is enabled the output from the
1329.Ic netdata
1330command will be formatted in a more user readable format.
1331Spaces are put between each character in the output, and the
1332beginning of any
7ba0088d 1333.Nm
b7080c8e
A
1334escape sequence is preceded by a '*' to aid in locating them.
1335.It Ic skiprc
1336When the skiprc toggle is
1337.Dv TRUE ,
7ba0088d 1338.Nm
b7080c8e
A
1339skips the reading of the
1340.Pa \&.telnetrc
1341file in the users home
1342directory when connections are opened. The initial
1343value for this toggle is
7ba0088d 1344.Dv FALSE .
b7080c8e
A
1345.It Ic termdata
1346Toggles the display of all terminal data (in hexadecimal format).
1347The initial value for this toggle is
1348.Dv FALSE .
1349.It Ic verbose_encrypt
1350When the
1351.Ic verbose_encrypt
1352toggle is
1353.Dv TRUE ,
7ba0088d 1354.Nm
b7080c8e
A
1355prints out a message each time encryption is enabled or
1356disabled. The initial value for this toggle is
7ba0088d
A
1357.Dv FALSE .
1358.It Ic ?\&
b7080c8e
A
1359Displays the legal
1360.Ic toggle
1361commands.
1362.El
1363.It Ic z
1364Suspend
7ba0088d 1365.Nm .
b7080c8e
A
1366This command only works when the user is using the
1367.Xr csh 1 .
7ba0088d 1368.It Ic \&! Op Ar command
b7080c8e
A
1369Execute a single command in a subshell on the local
1370system. If
7ba0088d 1371.Ar command
b7080c8e
A
1372is omitted, then an interactive
1373subshell is invoked.
7ba0088d 1374.It Ic ?\& Op Ar command
b7080c8e 1375Get help. With no arguments,
7ba0088d 1376.Nm
b7080c8e 1377prints a help summary.
7ba0088d
A
1378If
1379.Ar command
1380is specified,
1381.Nm
b7080c8e
A
1382will print the help information for just that command.
1383.El
1384.Sh ENVIRONMENT
7ba0088d 1385.Nm
b7080c8e
A
1386uses at least the
1387.Ev HOME ,
1388.Ev SHELL ,
1389.Ev DISPLAY ,
1390and
1391.Ev TERM
1392environment variables.
1393Other environment variables may be propagated
1394to the other side via the
1395.Dv TELNET ENVIRON
1396option.
7ba0088d
A
1397.Sh SEE ALSO
1398.Xr rlogin 1 ,
1399.Xr rsh 1 ,
1400.Xr hosts 5 ,
1401.Xr nologin 5 ,
1402.Xr telnetd 8
b7080c8e
A
1403.Sh FILES
1404.Bl -tag -width ~/.telnetrc -compact
1405.It Pa ~/.telnetrc
1406user customized telnet startup values
1407.El
1408.Sh HISTORY
1409The
7ba0088d 1410.Nm
b7080c8e
A
1411command appeared in
1412.Bx 4.2 .
b7080c8e 1413.Pp
7ba0088d
A
1414IPv6 support was added by WIDE/KAME project.
1415.Sh NOTES
b7080c8e
A
1416On some remote systems, echo has to be turned off manually when in
1417\*(Lqold line by line\*(Rq mode.
1418.Pp
7ba0088d 1419In \*(Lqold line by line\*(Rq mode or
b7080c8e
A
1420.Dv LINEMODE
1421the terminal's
1422.Ic eof
1423character is only recognized (and sent to the remote system)
1424when it is the first character on a line.