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