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