Debian Codegraph @

upstream/mageia-cauldron/man1/telnet.1

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