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