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