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