Debian Codegraph @

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