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