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