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