Debian Codegraph @

upstream/debian-unstable/man1/inetutils-telnet.1

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