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