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