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