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