xref: /freebsd/contrib/telnet/telnet/telnet.1 (revision 2f513db7)
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. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	@(#)telnet.1	8.6 (Berkeley) 6/1/94
29.\" $FreeBSD$
30.\"
31.Dd September 18, 2006
32.Dt TELNET 1
33.Os
34.Sh NAME
35.Nm telnet
36.Nd user interface to the
37.Tn TELNET
38protocol
39.Sh SYNOPSIS
40.Nm
41.Op Fl 468EFKLNacdfruxy
42.Op Fl B Ar baudrate
43.Op Fl S Ar tos
44.Op Fl X Ar authtype
45.Op Fl e Ar escapechar
46.Op Fl k Ar realm
47.Op Fl l Ar user
48.Op Fl n Ar tracefile
49.Op Fl s Ar src_addr
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 Dq Li telnet\&> .
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 B Ar baudrate
90Sets the baud rate to
91.Ar baudrate .
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.Bl -tag -width "mode type"
348.It Ic auth Ar argument ...
349The auth command manipulates the information sent through the
350.Dv TELNET AUTHENTICATE
351option.
352Valid arguments for the
353.Ic auth
354command are:
355.Bl -tag -width "disable type"
356.It Ic disable Ar type
357Disables the specified type of authentication.
358To
359obtain a list of available types, use the
360.Ic auth disable ?\&
361command.
362.It Ic enable Ar type
363Enables the specified type of authentication.
364To
365obtain a list of available types, use the
366.Ic auth enable ?\&
367command.
368.It Ic status
369Lists the current status of the various types of
370authentication.
371.El
372.It Ic close
373Close a
374.Tn TELNET
375session and return to command mode.
376.It Ic display Ar argument ...
377Displays all, or some, of the
378.Ic set
379and
380.Ic toggle
381values (see below).
382.It Ic encrypt Ar argument ...
383The encrypt command manipulates the information sent through the
384.Dv TELNET ENCRYPT
385option.
386.Pp
387Valid arguments for the
388.Ic encrypt
389command are:
390.Bl -tag -width Ar
391.It Ic disable Ar type Xo
392.Op Cm input | output
393.Xc
394Disables the specified type of encryption.
395If you
396omit the input and output, both input and output
397are disabled.
398To obtain a list of available
399types, use the
400.Ic encrypt disable ?\&
401command.
402.It Ic enable Ar type Xo
403.Op Cm input | output
404.Xc
405Enables the specified type of encryption.
406If you
407omit input and output, both input and output are
408enabled.
409To obtain a list of available types, use the
410.Ic encrypt enable ?\&
411command.
412.It Ic input
413This is the same as the
414.Ic encrypt start input
415command.
416.It Ic -input
417This is the same as the
418.Ic encrypt stop input
419command.
420.It Ic output
421This is the same as the
422.Ic encrypt start output
423command.
424.It Ic -output
425This is the same as the
426.Ic encrypt stop output
427command.
428.It Ic start Op Cm input | output
429Attempts to start encryption.
430If you omit
431.Ic input
432and
433.Ic output ,
434both input and output are enabled.
435To
436obtain a list of available types, use the
437.Ic encrypt enable ?\&
438command.
439.It Ic status
440Lists the current status of encryption.
441.It Ic stop Op Cm input | output
442Stops encryption.
443If you omit input and output,
444encryption is on both input and output.
445.It Ic type Ar type
446Sets the default type of encryption to be used
447with later
448.Ic encrypt start
449or
450.Ic encrypt stop
451commands.
452.El
453.It Ic environ Ar arguments ...
454The
455.Ic environ
456command is used to manipulate the
457variables that may be sent through the
458.Dv TELNET ENVIRON
459option.
460The initial set of variables is taken from the users
461environment, with only the
462.Ev DISPLAY
463and
464.Ev PRINTER
465variables being exported by default.
466The
467.Ev USER
468variable is also exported if the
469.Fl a
470or
471.Fl l
472options are used.
473.Pp
474Valid arguments for the
475.Ic environ
476command are:
477.Bl -tag -width Fl
478.It Ic define Ar variable value
479Define the variable
480.Ar variable
481to have a value of
482.Ar value .
483Any variables defined by this command are automatically exported.
484The
485.Ar value
486may be enclosed in single or double quotes so
487that tabs and spaces may be included.
488.It Ic undefine Ar variable
489Remove
490.Ar variable
491from the list of environment variables.
492.It Ic export Ar variable
493Mark the variable
494.Ar variable
495to be exported to the remote side.
496.It Ic unexport Ar variable
497Mark the variable
498.Ar variable
499to not be exported unless
500explicitly asked for by the remote side.
501.It Ic list
502List the current set of environment variables.
503Those marked with a
504.Cm *
505will be sent automatically,
506other variables will only be sent if explicitly requested.
507.It Ic ?\&
508Prints out help information for the
509.Ic environ
510command.
511.El
512.It Ic logout
513Sends the
514.Dv TELNET LOGOUT
515option to the remote side.
516This command is similar to a
517.Ic close
518command; however, if the remote side does not support the
519.Dv LOGOUT
520option, nothing happens.
521If, however, the remote side does support the
522.Dv LOGOUT
523option, this command should cause the remote side to close the
524.Tn TELNET
525connection.
526If the remote side also supports the concept of
527suspending a user's session for later reattachment,
528the logout argument indicates that you
529should terminate the session immediately.
530.It Ic mode Ar type
531.Ar Type
532is one of several options, depending on the state of the
533.Tn TELNET
534session.
535The remote host is asked for permission to go into the requested mode.
536If the remote host is capable of entering that mode, the requested
537mode will be entered.
538.Bl -tag -width Ar
539.It Ic character
540Disable the
541.Dv TELNET LINEMODE
542option, or, if the remote side does not understand the
543.Dv LINEMODE
544option, then enter \*(Lqcharacter at a time\*(Rq mode.
545.It Ic line
546Enable the
547.Dv TELNET LINEMODE
548option, or, if the remote side does not understand the
549.Dv LINEMODE
550option, then attempt to enter \*(Lqold-line-by-line\*(Rq mode.
551.It Ic isig Pq Ic \-isig
552Attempt to enable (disable) the
553.Dv TRAPSIG
554mode of the
555.Dv LINEMODE
556option.
557This requires that the
558.Dv LINEMODE
559option be enabled.
560.It Ic edit Pq Ic \-edit
561Attempt to enable (disable) the
562.Dv EDIT
563mode of the
564.Dv LINEMODE
565option.
566This requires that the
567.Dv LINEMODE
568option be enabled.
569.It Ic softtabs Pq Ic \-softtabs
570Attempt to enable (disable) the
571.Dv SOFT_TAB
572mode of the
573.Dv LINEMODE
574option.
575This requires that the
576.Dv LINEMODE
577option be enabled.
578.It Ic litecho Pq Ic \-litecho
579Attempt to enable (disable) the
580.Dv LIT_ECHO
581mode of the
582.Dv LINEMODE
583option.
584This requires that the
585.Dv LINEMODE
586option be enabled.
587.It Ic ?\&
588Prints out help information for the
589.Ic mode
590command.
591.El
592.It Xo
593.Ic open
594.Op Fl l Ar user
595.Op Ar host
596.Op Oo Fl /+ Oc Ns Ar port
597.Xc
598Open a connection to the named host.
599If no port number
600is specified,
601.Nm
602will attempt to contact a
603.Tn TELNET
604server at the default port.
605The host specification may be either a host name (see
606.Xr hosts 5 ) ,
607an Internet address specified in the \*(Lqdot notation\*(Rq (see
608.Xr inet 3 ) ,
609or IPv6 host name or IPv6 coloned-hexadecimal addreess.
610The
611.Fl l
612option may be used to specify the user name
613to be passed to the remote system via the
614.Ev ENVIRON
615option.
616When connecting to a non-standard port,
617.Nm
618omits any automatic initiation of
619.Tn TELNET
620options.
621When the port number is preceded by a minus sign,
622the initial option negotiation is done.
623When, however, the port number
624is preceded by a plus sign,
625any option negotiation and understanding is prohibited,
626making telnet dumb client for POP3/SMTP/NNTP/HTTP-like
627protocols with any data including
628.Tn TELNET
629IAC character (0xff).
630After establishing a connection, the file
631.Pa \&.telnetrc
632in the
633users home directory is opened.
634Lines beginning with a # are
635comment lines.
636Blank lines are ignored.
637Lines that begin
638without white space are the start of a machine entry.
639The
640first thing on the line is the name of the machine that is
641being connected to.
642It may be the hostname or numeric address specified as the argument
643.Ar host ,
644the canonical name of that string as determined by
645.Xr getaddrinfo 3 ,
646or the string
647.Dq Li DEFAULT
648indicating all hosts.
649The rest of the line, and successive
650lines that begin with white space are assumed to be
651.Nm
652commands and are processed as if they had been typed
653in manually to the
654.Nm
655command prompt.
656.It Ic quit
657Close any open
658.Tn TELNET
659session and exit
660.Nm .
661An end of file (in command mode) will also close a session and exit.
662.It Ic send Ar arguments
663Sends one or more special character sequences to the remote host.
664The following are the arguments which may be specified
665(more than one argument may be specified at a time):
666.Bl -tag -width escape
667.It Ic abort
668Sends the
669.Dv TELNET ABORT
670(Abort
671processes)
672sequence.
673.It Ic ao
674Sends the
675.Dv TELNET AO
676(Abort Output) sequence, which should cause the remote system to flush
677all output
678.Em from
679the remote system
680.Em to
681the user's terminal.
682.It Ic ayt
683Sends the
684.Dv TELNET AYT
685(Are You There)
686sequence, to which the remote system may or may not choose to respond.
687.It Ic brk
688Sends the
689.Dv TELNET BRK
690(Break) sequence, which may have significance to the remote
691system.
692.It Ic ec
693Sends the
694.Dv TELNET EC
695(Erase Character)
696sequence, which should cause the remote system to erase the last character
697entered.
698.It Ic el
699Sends the
700.Dv TELNET EL
701(Erase Line)
702sequence, which should cause the remote system to erase the line currently
703being entered.
704.It Ic eof
705Sends the
706.Dv TELNET EOF
707(End Of File)
708sequence.
709.It Ic eor
710Sends the
711.Dv TELNET EOR
712(End of Record)
713sequence.
714.It Ic escape
715Sends the current
716.Nm
717escape character (initially \*(Lq^\*(Rq).
718.It Ic ga
719Sends the
720.Dv TELNET GA
721(Go Ahead)
722sequence, which likely has no significance to the remote system.
723.It Ic getstatus
724If the remote side supports the
725.Dv TELNET STATUS
726command,
727.Ic getstatus
728will send the subnegotiation to request that the server send
729its current option status.
730.It Ic ip
731Sends the
732.Dv TELNET IP
733(Interrupt Process) sequence, which should cause the remote
734system to abort the currently running process.
735.It Ic nop
736Sends the
737.Dv TELNET NOP
738(No OPeration)
739sequence.
740.It Ic susp
741Sends the
742.Dv TELNET SUSP
743(SUSPend process)
744sequence.
745.It Ic synch
746Sends the
747.Dv TELNET SYNCH
748sequence.
749This sequence causes the remote system to discard all previously typed
750(but not yet read) input.
751This sequence is sent as
752.Tn TCP
753urgent
754data (and may not work if the remote system is a
755.Bx 4.2
756system -- if
757it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
758.It Ic do Ar cmd
759.It Ic dont Ar cmd
760.It Ic will Ar cmd
761.It Ic wont Ar cmd
762Sends the
763.Dv TELNET DO
764.Ar cmd
765sequence.
766.Ar Cmd
767can be either a decimal number between 0 and 255,
768or a symbolic name for a specific
769.Dv TELNET
770command.
771.Ar Cmd
772can also be either
773.Ic help
774or
775.Ic ?\&
776to print out help information, including
777a list of known symbolic names.
778.It Ic ?\&
779Prints out help information for the
780.Ic send
781command.
782.El
783.It Ic set Ar argument value
784.It Ic unset Ar argument value
785The
786.Ic set
787command will set any one of a number of
788.Nm
789variables to a specific value or to
790.Dv TRUE .
791The special value
792.Ic off
793turns off the function associated with
794the variable, this is equivalent to using the
795.Ic unset
796command.
797The
798.Ic unset
799command will disable or set to
800.Dv FALSE
801any of the specified functions.
802The values of variables may be interrogated with the
803.Ic display
804command.
805The variables which may be set or unset, but not toggled, are
806listed here.
807In addition, any of the variables for the
808.Ic toggle
809command may be explicitly set or unset using
810the
811.Ic set
812and
813.Ic unset
814commands.
815.Bl -tag -width escape
816.It Ic ayt
817If
818.Tn TELNET
819is in localchars mode, or
820.Dv LINEMODE
821is enabled, and the status character is typed, a
822.Dv TELNET AYT
823sequence (see
824.Ic send ayt
825preceding) is sent to the
826remote host.
827The initial value for the \*(LqAre You There\*(Rq
828character is the terminal's status character.
829.It Ic echo
830This is the value (initially \*(Lq^E\*(Rq) which, when in
831\*(Lqline by line\*(Rq mode, toggles between doing local echoing
832of entered characters (for normal processing), and suppressing
833echoing of entered characters (for entering, say, a password).
834.It Ic eof
835If
836.Nm
837is operating in
838.Dv LINEMODE
839or \*(Lqold line by line\*(Rq mode, entering this character
840as the first character on a line will cause this character to be
841sent to the remote system.
842The initial value of the eof character is taken to be the terminal's
843.Ic eof
844character.
845.It Ic erase
846If
847.Nm
848is in
849.Ic localchars
850mode (see
851.Ic toggle
852.Ic localchars
853below),
854.Sy and
855if
856.Nm
857is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
858character is typed, a
859.Dv TELNET EC
860sequence (see
861.Ic send
862.Ic ec
863above)
864is sent to the remote system.
865The initial value for the erase character is taken to be
866the terminal's
867.Ic erase
868character.
869.It Ic escape
870This is the
871.Nm
872escape character (initially \*(Lq^[\*(Rq) which causes entry
873into
874.Nm
875command mode (when connected to a remote system).
876.It Ic flushoutput
877If
878.Nm
879is in
880.Ic localchars
881mode (see
882.Ic toggle
883.Ic localchars
884below)
885and the
886.Ic flushoutput
887character is typed, a
888.Dv TELNET AO
889sequence (see
890.Ic send
891.Ic ao
892above)
893is sent to the remote host.
894The initial value for the flush character is taken to be
895the terminal's
896.Ic flush
897character.
898.It Ic forw1
899.It Ic forw2
900If
901.Nm
902is operating in
903.Dv LINEMODE ,
904these are the
905characters that, when typed, cause partial lines to be
906forwarded to the remote system.
907The initial value for
908the forwarding characters are taken from the terminal's
909eol and eol2 characters.
910.It Ic interrupt
911If
912.Nm
913is in
914.Ic localchars
915mode (see
916.Ic toggle
917.Ic localchars
918below)
919and the
920.Ic interrupt
921character is typed, a
922.Dv TELNET IP
923sequence (see
924.Ic send
925.Ic ip
926above)
927is sent to the remote host.
928The initial value for the interrupt character is taken to be
929the terminal's
930.Ic intr
931character.
932.It Ic kill
933If
934.Nm
935is in
936.Ic localchars
937mode (see
938.Ic toggle
939.Ic localchars
940below),
941.Ic and
942if
943.Nm
944is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
945character is typed, a
946.Dv TELNET EL
947sequence (see
948.Ic send
949.Ic el
950above)
951is sent to the remote system.
952The initial value for the kill character is taken to be
953the terminal's
954.Ic kill
955character.
956.It Ic lnext
957If
958.Nm
959is operating in
960.Dv LINEMODE
961or \*(Lqold line by line\*(Rq mode, then this character is taken to
962be the terminal's
963.Ic lnext
964character.
965The initial value for the lnext character is taken to be
966the terminal's
967.Ic lnext
968character.
969.It Ic quit
970If
971.Nm
972is in
973.Ic localchars
974mode (see
975.Ic toggle
976.Ic localchars
977below)
978and the
979.Ic quit
980character is typed, a
981.Dv TELNET BRK
982sequence (see
983.Ic send
984.Ic brk
985above)
986is sent to the remote host.
987The initial value for the quit character is taken to be
988the terminal's
989.Ic quit
990character.
991.It Ic reprint
992If
993.Nm
994is operating in
995.Dv LINEMODE
996or \*(Lqold line by line\*(Rq mode, then this character is taken to
997be the terminal's
998.Ic reprint
999character.
1000The initial value for the reprint character is taken to be
1001the terminal's
1002.Ic reprint
1003character.
1004.It Ic rlogin
1005This is the rlogin escape character.
1006If set, the normal
1007.Nm
1008escape character is ignored unless it is
1009preceded by this character at the beginning of a line.
1010This character, at the beginning of a line followed by
1011a "." closes the connection; when followed by a ^Z it
1012suspends the
1013.Nm
1014command.
1015The initial state is to
1016disable the
1017.Nm rlogin
1018escape character.
1019.It Ic start
1020If the
1021.Dv TELNET TOGGLE-FLOW-CONTROL
1022option has been enabled,
1023then this character is taken to
1024be the terminal's
1025.Ic start
1026character.
1027The initial value for the start character is taken to be
1028the terminal's
1029.Ic start
1030character.
1031.It Ic stop
1032If the
1033.Dv TELNET TOGGLE-FLOW-CONTROL
1034option has been enabled,
1035then this character is taken to
1036be the terminal's
1037.Ic stop
1038character.
1039The initial value for the stop character is taken to be
1040the terminal's
1041.Ic stop
1042character.
1043.It Ic susp
1044If
1045.Nm
1046is in
1047.Ic localchars
1048mode, or
1049.Dv LINEMODE
1050is enabled, and the
1051.Ic suspend
1052character is typed, a
1053.Dv TELNET SUSP
1054sequence (see
1055.Ic send
1056.Ic susp
1057above)
1058is sent to the remote host.
1059The initial value for the suspend character is taken to be
1060the terminal's
1061.Ic suspend
1062character.
1063.It Ic tracefile
1064This is the file to which the output, caused by
1065.Ic netdata
1066or
1067.Ic option
1068tracing being
1069.Dv TRUE ,
1070will be written.
1071If it is set to
1072.Dq Fl ,
1073then tracing information will be written to standard output (the default).
1074.It Ic worderase
1075If
1076.Nm
1077is operating in
1078.Dv LINEMODE
1079or \*(Lqold line by line\*(Rq mode, then this character is taken to
1080be the terminal's
1081.Ic worderase
1082character.
1083The initial value for the worderase character is taken to be
1084the terminal's
1085.Ic worderase
1086character.
1087.It Ic ?\&
1088Displays the legal
1089.Ic set
1090.Pq Ic unset
1091commands.
1092.El
1093.It Ic opie Ar sequence challenge
1094The
1095.Ic opie
1096command computes a response to the OPIE challenge.
1097.It Ic slc Ar state
1098The
1099.Ic slc
1100command (Set Local Characters) is used to set
1101or change the state of the special
1102characters when the
1103.Dv TELNET LINEMODE
1104option has
1105been enabled.
1106Special characters are characters that get
1107mapped to
1108.Tn TELNET
1109commands sequences (like
1110.Ic ip
1111or
1112.Ic quit )
1113or line editing characters (like
1114.Ic erase
1115and
1116.Ic kill ) .
1117By default, the local special characters are exported.
1118.Bl -tag -width Fl
1119.It Ic check
1120Verify the current settings for the current special characters.
1121The remote side is requested to send all the current special
1122character settings, and if there are any discrepancies with
1123the local side, the local side will switch to the remote value.
1124.It Ic export
1125Switch to the local defaults for the special characters.
1126The
1127local default characters are those of the local terminal at
1128the time when
1129.Nm
1130was started.
1131.It Ic import
1132Switch to the remote defaults for the special characters.
1133The remote default characters are those of the remote system
1134at the time when the
1135.Tn TELNET
1136connection was established.
1137.It Ic ?\&
1138Prints out help information for the
1139.Ic slc
1140command.
1141.El
1142.It Ic status
1143Show the current status of
1144.Nm .
1145This includes the peer one is connected to, as well
1146as the current mode.
1147.It Ic toggle Ar arguments ...
1148Toggle (between
1149.Dv TRUE
1150and
1151.Dv FALSE )
1152various flags that control how
1153.Nm
1154responds to events.
1155These flags may be set explicitly to
1156.Dv TRUE
1157or
1158.Dv FALSE
1159using the
1160.Ic set
1161and
1162.Ic unset
1163commands listed above.
1164More than one argument may be specified.
1165The state of these flags may be interrogated with the
1166.Ic display
1167command.
1168Valid arguments are:
1169.Bl -tag -width Ar
1170.It Ic authdebug
1171Turns on debugging information for the authentication code.
1172.It Ic autoflush
1173If
1174.Ic autoflush
1175and
1176.Ic localchars
1177are both
1178.Dv TRUE ,
1179then when the
1180.Ic ao ,
1181or
1182.Ic quit
1183characters are recognized (and transformed into
1184.Tn TELNET
1185sequences; see
1186.Ic set
1187above for details),
1188.Nm
1189refuses to display any data on the user's terminal
1190until the remote system acknowledges (via a
1191.Dv TELNET TIMING MARK
1192option)
1193that it has processed those
1194.Tn TELNET
1195sequences.
1196The initial value for this toggle is
1197.Dv TRUE
1198if the terminal user had not
1199done an "stty noflsh", otherwise
1200.Dv FALSE
1201(see
1202.Xr stty 1 ) .
1203.It Ic autodecrypt
1204When the
1205.Dv TELNET ENCRYPT
1206option is negotiated, by
1207default the actual encryption (decryption) of the data
1208stream does not start automatically.
1209The autoencrypt
1210(autodecrypt) command states that encryption of the
1211output (input) stream should be enabled as soon as
1212possible.
1213.It Ic autologin
1214If the remote side supports the
1215.Dv TELNET AUTHENTICATION
1216option
1217.Nm
1218attempts to use it to perform automatic authentication.
1219If the
1220.Dv AUTHENTICATION
1221option is not supported, the user's login
1222name are propagated through the
1223.Dv TELNET ENVIRON
1224option.
1225This command is the same as specifying
1226.Fl a
1227option on the
1228.Ic open
1229command.
1230.It Ic autosynch
1231If
1232.Ic autosynch
1233and
1234.Ic localchars
1235are both
1236.Dv TRUE ,
1237then when either the
1238.Ic intr
1239or
1240.Ic quit
1241characters is typed (see
1242.Ic set
1243above for descriptions of the
1244.Ic intr
1245and
1246.Ic quit
1247characters), the resulting
1248.Tn TELNET
1249sequence sent is followed by the
1250.Dv TELNET SYNCH
1251sequence.
1252This procedure
1253.Ic should
1254cause the remote system to begin throwing away all previously
1255typed input until both of the
1256.Tn TELNET
1257sequences have been read and acted upon.
1258The initial value of this toggle is
1259.Dv FALSE .
1260.It Ic binary
1261Enable or disable the
1262.Dv TELNET BINARY
1263option on both input and output.
1264.It Ic inbinary
1265Enable or disable the
1266.Dv TELNET BINARY
1267option on input.
1268.It Ic outbinary
1269Enable or disable the
1270.Dv TELNET BINARY
1271option on output.
1272.It Ic crlf
1273If this is
1274.Dv TRUE ,
1275then carriage returns will be sent as
1276.Li <CR><LF> .
1277If this is
1278.Dv FALSE ,
1279then carriage returns will be send as
1280.Li <CR><NUL> .
1281The initial value for this toggle is
1282.Dv FALSE .
1283.It Ic crmod
1284Toggle carriage return mode.
1285When this mode is enabled, most carriage return characters received from
1286the remote host will be mapped into a carriage return followed by
1287a line feed.
1288This mode does not affect those characters typed by the user, only
1289those received from the remote host.
1290This mode is not very useful unless the remote host
1291only sends carriage return, but never line feed.
1292The initial value for this toggle is
1293.Dv FALSE .
1294.It Ic debug
1295Toggles socket level debugging (useful only to the
1296.Ic super user ) .
1297The initial value for this toggle is
1298.Dv FALSE .
1299.It Ic encdebug
1300Turns on debugging information for the encryption code.
1301.It Ic localchars
1302If this is
1303.Dv TRUE ,
1304then the
1305.Ic flush ,
1306.Ic interrupt ,
1307.Ic quit ,
1308.Ic erase ,
1309and
1310.Ic kill
1311characters (see
1312.Ic set
1313above) are recognized locally, and transformed into (hopefully) appropriate
1314.Tn TELNET
1315control sequences
1316(respectively
1317.Ic ao ,
1318.Ic ip ,
1319.Ic brk ,
1320.Ic ec ,
1321and
1322.Ic el ;
1323see
1324.Ic send
1325above).
1326The initial value for this toggle is
1327.Dv TRUE
1328in \*(Lqold line by line\*(Rq mode,
1329and
1330.Dv FALSE
1331in \*(Lqcharacter at a time\*(Rq mode.
1332When the
1333.Dv LINEMODE
1334option is enabled, the value of
1335.Ic localchars
1336is ignored, and assumed to always be
1337.Dv TRUE .
1338If
1339.Dv LINEMODE
1340has ever been enabled, then
1341.Ic quit
1342is sent as
1343.Ic abort ,
1344and
1345.Ic eof
1346and
1347.Ic suspend
1348are sent as
1349.Ic eof
1350and
1351.Ic susp
1352(see
1353.Ic send
1354above).
1355.It Ic netdata
1356Toggles the display of all network data (in hexadecimal format).
1357The initial value for this toggle is
1358.Dv FALSE .
1359.It Ic options
1360Toggles the display of some internal
1361.Nm
1362protocol processing (having to do with
1363.Tn TELNET
1364options).
1365The initial value for this toggle is
1366.Dv FALSE .
1367.It Ic prettydump
1368When the
1369.Ic netdata
1370toggle is enabled, if
1371.Ic prettydump
1372is enabled the output from the
1373.Ic netdata
1374command will be formatted in a more user readable format.
1375Spaces are put between each character in the output, and the
1376beginning of any
1377.Nm
1378escape sequence is preceded by a '*' to aid in locating them.
1379.It Ic skiprc
1380When the skiprc toggle is
1381.Dv TRUE ,
1382.Nm
1383skips the reading of the
1384.Pa \&.telnetrc
1385file in the users home
1386directory when connections are opened.
1387The initial
1388value for this toggle is
1389.Dv FALSE .
1390.It Ic termdata
1391Toggles the display of all terminal data (in hexadecimal format).
1392The initial value for this toggle is
1393.Dv FALSE .
1394.It Ic verbose_encrypt
1395When the
1396.Ic verbose_encrypt
1397toggle is
1398.Dv TRUE ,
1399.Nm
1400prints out a message each time encryption is enabled or
1401disabled.
1402The initial value for this toggle is
1403.Dv FALSE .
1404.It Ic ?\&
1405Displays the legal
1406.Ic toggle
1407commands.
1408.El
1409.It Ic z
1410Suspend
1411.Nm .
1412This command only works when the user is using the
1413.Xr csh 1 .
1414.It Ic \&! Op Ar command
1415Execute a single command in a subshell on the local
1416system.
1417If
1418.Ar command
1419is omitted, then an interactive
1420subshell is invoked.
1421.It Ic ?\& Op Ar command
1422Get help.
1423With no arguments,
1424.Nm
1425prints a help summary.
1426If
1427.Ar command
1428is specified,
1429.Nm
1430will print the help information for just that command.
1431.El
1432.Sh ENVIRONMENT
1433.Nm
1434uses at least the
1435.Ev HOME ,
1436.Ev SHELL ,
1437.Ev DISPLAY ,
1438and
1439.Ev TERM
1440environment variables.
1441Other environment variables may be propagated
1442to the other side via the
1443.Dv TELNET ENVIRON
1444option.
1445.Sh FILES
1446.Bl -tag -width ~/.telnetrc -compact
1447.It Pa ~/.telnetrc
1448user customized telnet startup values
1449.El
1450.Sh SEE ALSO
1451.Xr rlogin 1 ,
1452.Xr rsh 1 ,
1453.Xr hosts 5 ,
1454.Xr nologin 5 ,
1455.Xr telnetd 8
1456.Sh HISTORY
1457The
1458.Nm
1459command appeared in
1460.Bx 4.2 .
1461.Pp
1462IPv6 support was added by WIDE/KAME project.
1463.Sh NOTES
1464On some remote systems, echo has to be turned off manually when in
1465\*(Lqold line by line\*(Rq mode.
1466.Pp
1467In \*(Lqold line by line\*(Rq mode or
1468.Dv LINEMODE
1469the terminal's
1470.Ic eof
1471character is only recognized (and sent to the remote system)
1472when it is the first character on a line.
1473