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