]> git.cameronkatri.com Git - apple_cmds.git/blob - remote_cmds/telnet.tproj/telnet.1
file_cmds: 321.100.10.0.1
[apple_cmds.git] / remote_cmds / 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 Only the first three are exported, by default.
450 .Pp
451 Valid arguments for the
452 .Ic environ
453 command are:
454 .Bl -tag -width Fl
455 .It Ic define Ar variable [value]
456 Define the variable
457 .Ar variable
458 to have a value of
459 .Ar value .
460 If value is empty, the value is taken from the environment variable.
461 Any variables defined by this command are automatically exported.
462 The
463 .Ar value
464 may be enclosed in single or double quotes so
465 that tabs and spaces may be included.
466 .It Ic undefine Ar variable
467 Remove
468 .Ar variable
469 from the list of environment variables.
470 .It Ic export Ar variable
471 Mark the variable
472 .Ar variable
473 to be exported to the remote side.
474 .It Ic unexport Ar variable
475 Mark the variable
476 .Ar variable
477 to not be exported unless
478 explicitly asked for by the remote side.
479 .It Ic list
480 List the current set of environment variables.
481 Those marked with a
482 .Cm *
483 will be sent automatically,
484 other variables will only be sent if explicitly requested.
485 .It Ic ?\&
486 Prints out help information for the
487 .Ic environ
488 command.
489 .El
490 .It Ic logout
491 Sends the
492 .Dv TELNET LOGOUT
493 option to the remote side.
494 This command is similar to a
495 .Ic close
496 command; however, if the remote side does not support the
497 .Dv LOGOUT
498 option, nothing happens.
499 If, however, the remote side does support the
500 .Dv LOGOUT
501 option, this command should cause the remote side to close the
502 .Tn TELNET
503 connection.
504 If the remote side also supports the concept of
505 suspending a user's session for later reattachment,
506 the logout argument indicates that you
507 should terminate the session immediately.
508 .It Ic mode Ar type
509 .Ar Type
510 is one of several options, depending on the state of the
511 .Tn TELNET
512 session.
513 The remote host is asked for permission to go into the requested mode.
514 If the remote host is capable of entering that mode, the requested
515 mode will be entered.
516 .Bl -tag -width Ar
517 .It Ic character
518 Disable the
519 .Dv TELNET LINEMODE
520 option, or, if the remote side does not understand the
521 .Dv LINEMODE
522 option, then enter \*(Lqcharacter at a time\*(Rq mode.
523 .It Ic line
524 Enable the
525 .Dv TELNET LINEMODE
526 option, or, if the remote side does not understand the
527 .Dv LINEMODE
528 option, then attempt to enter \*(Lqold-line-by-line\*(Rq mode.
529 .It Ic isig Pq Ic \-isig
530 Attempt to enable (disable) the
531 .Dv TRAPSIG
532 mode of the
533 .Dv LINEMODE
534 option.
535 This requires that the
536 .Dv LINEMODE
537 option be enabled.
538 .It Ic edit Pq Ic \-edit
539 Attempt to enable (disable) the
540 .Dv EDIT
541 mode of the
542 .Dv LINEMODE
543 option.
544 This requires that the
545 .Dv LINEMODE
546 option be enabled.
547 .It Ic softtabs Pq Ic \-softtabs
548 Attempt to enable (disable) the
549 .Dv SOFT_TAB
550 mode of the
551 .Dv LINEMODE
552 option.
553 This requires that the
554 .Dv LINEMODE
555 option be enabled.
556 .It Ic litecho Pq Ic \-litecho
557 Attempt to enable (disable) the
558 .Dv LIT_ECHO
559 mode of the
560 .Dv LINEMODE
561 option.
562 This requires that the
563 .Dv LINEMODE
564 option be enabled.
565 .It Ic ?\&
566 Prints out help information for the
567 .Ic mode
568 command.
569 .El
570 .It Xo
571 .Ic open Ar host
572 .Op Fl l Ar user
573 .Op Oo Fl Oc Ns Ar port
574 .Xc
575 Open a connection to the named host.
576 If no port number
577 is specified,
578 .Nm
579 will attempt to contact a
580 .Tn TELNET
581 server at the default port.
582 The host specification may be either a host name (see
583 .Xr hosts 5 ) ,
584 an Internet address specified in the \*(Lqdot notation\*(Rq (see
585 .Xr inet 3 ) ,
586 or IPv6 host name or IPv6 coloned-hexadecimal addreess.
587 The
588 .Fl l
589 option may be used to specify the user name
590 to be passed to the remote system via the
591 .Ev ENVIRON
592 option.
593 When connecting to a non-standard port,
594 .Nm
595 omits any automatic initiation of
596 .Tn TELNET
597 options. When the port number is preceded by a minus sign,
598 the initial option negotiation is done.
599 After establishing a connection, the file
600 .Pa \&.telnetrc
601 in the
602 users home directory is opened. Lines beginning with a # are
603 comment lines. Blank lines are ignored. Lines that begin
604 without white space are the start of a machine entry. The
605 first thing on the line is the name of the machine that is
606 being connected to. The rest of the line, and successive
607 lines that begin with white space are assumed to be
608 .Nm
609 commands and are processed as if they had been typed
610 in manually to the
611 .Nm
612 command prompt.
613 .It Ic quit
614 Close any open
615 .Tn TELNET
616 session and exit
617 .Nm .
618 An end of file (in command mode) will also close a session and exit.
619 .It Ic send Ar arguments
620 Sends one or more special character sequences to the remote host.
621 The following are the arguments which may be specified
622 (more than one argument may be specified at a time):
623 .Pp
624 .Bl -tag -width escape
625 .It Ic abort
626 Sends the
627 .Dv TELNET ABORT
628 (Abort
629 processes)
630 sequence.
631 .It Ic ao
632 Sends the
633 .Dv TELNET AO
634 (Abort Output) sequence, which should cause the remote system to flush
635 all output
636 .Em from
637 the remote system
638 .Em to
639 the user's terminal.
640 .It Ic ayt
641 Sends the
642 .Dv TELNET AYT
643 (Are You There)
644 sequence, to which the remote system may or may not choose to respond.
645 .It Ic brk
646 Sends the
647 .Dv TELNET BRK
648 (Break) sequence, which may have significance to the remote
649 system.
650 .It Ic ec
651 Sends the
652 .Dv TELNET EC
653 (Erase Character)
654 sequence, which should cause the remote system to erase the last character
655 entered.
656 .It Ic el
657 Sends the
658 .Dv TELNET EL
659 (Erase Line)
660 sequence, which should cause the remote system to erase the line currently
661 being entered.
662 .It Ic eof
663 Sends the
664 .Dv TELNET EOF
665 (End Of File)
666 sequence.
667 .It Ic eor
668 Sends the
669 .Dv TELNET EOR
670 (End of Record)
671 sequence.
672 .It Ic escape
673 Sends the current
674 .Nm
675 escape character (initially \*(Lq^\*(Rq).
676 .It Ic ga
677 Sends the
678 .Dv TELNET GA
679 (Go Ahead)
680 sequence, which likely has no significance to the remote system.
681 .It Ic getstatus
682 If the remote side supports the
683 .Dv TELNET STATUS
684 command,
685 .Ic getstatus
686 will send the subnegotiation to request that the server send
687 its current option status.
688 .It Ic ip
689 Sends the
690 .Dv TELNET IP
691 (Interrupt Process) sequence, which should cause the remote
692 system to abort the currently running process.
693 .It Ic nop
694 Sends the
695 .Dv TELNET NOP
696 (No OPeration)
697 sequence.
698 .It Ic susp
699 Sends the
700 .Dv TELNET SUSP
701 (SUSPend process)
702 sequence.
703 .It Ic synch
704 Sends the
705 .Dv TELNET SYNCH
706 sequence.
707 This sequence causes the remote system to discard all previously typed
708 (but not yet read) input.
709 This sequence is sent as
710 .Tn TCP
711 urgent
712 data (and may not work if the remote system is a
713 .Bx 4.2
714 system -- if
715 it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
716 .It Ic do Ar cmd
717 .It Ic dont Ar cmd
718 .It Ic will Ar cmd
719 .It Ic wont Ar cmd
720 Sends the
721 .Dv TELNET DO
722 .Ar cmd
723 sequence.
724 .Ar Cmd
725 can be either a decimal number between 0 and 255,
726 or a symbolic name for a specific
727 .Dv TELNET
728 command.
729 .Ar Cmd
730 can also be either
731 .Ic help
732 or
733 .Ic ?\&
734 to print out help information, including
735 a list of known symbolic names.
736 .It Ic ?\&
737 Prints out help information for the
738 .Ic send
739 command.
740 .El
741 .It Ic set Ar argument value
742 .It Ic unset Ar argument value
743 The
744 .Ic set
745 command will set any one of a number of
746 .Nm
747 variables to a specific value or to
748 .Dv TRUE .
749 The special value
750 .Ic off
751 turns off the function associated with
752 the variable, this is equivalent to using the
753 .Ic unset
754 command.
755 The
756 .Ic unset
757 command will disable or set to
758 .Dv FALSE
759 any of the specified functions.
760 The values of variables may be interrogated with the
761 .Ic display
762 command.
763 The variables which may be set or unset, but not toggled, are
764 listed here. In addition, any of the variables for the
765 .Ic toggle
766 command may be explicitly set or unset using
767 the
768 .Ic set
769 and
770 .Ic unset
771 commands.
772 .Bl -tag -width escape
773 .It Ic ayt
774 If
775 .Tn TELNET
776 is in localchars mode, or
777 .Dv LINEMODE
778 is enabled, and the status character is typed, a
779 .Dv TELNET AYT
780 sequence (see
781 .Ic send ayt
782 preceding) is sent to the
783 remote host. The initial value for the \*(LqAre You There\*(Rq
784 character is the terminal's status character.
785 .It Ic echo
786 This is the value (initially \*(Lq^E\*(Rq) which, when in
787 \*(Lqline by line\*(Rq mode, toggles between doing local echoing
788 of entered characters (for normal processing), and suppressing
789 echoing of entered characters (for entering, say, a password).
790 .It Ic eof
791 If
792 .Nm
793 is operating in
794 .Dv LINEMODE
795 or \*(Lqold line by line\*(Rq mode, entering this character
796 as the first character on a line will cause this character to be
797 sent to the remote system.
798 The initial value of the eof character is taken to be the terminal's
799 .Ic eof
800 character.
801 .It Ic erase
802 If
803 .Nm
804 is in
805 .Ic localchars
806 mode (see
807 .Ic toggle
808 .Ic localchars
809 below),
810 .Sy and
811 if
812 .Nm
813 is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
814 character is typed, a
815 .Dv TELNET EC
816 sequence (see
817 .Ic send
818 .Ic ec
819 above)
820 is sent to the remote system.
821 The initial value for the erase character is taken to be
822 the terminal's
823 .Ic erase
824 character.
825 .It Ic escape
826 This is the
827 .Nm
828 escape character (initially \*(Lq^[\*(Rq) which causes entry
829 into
830 .Nm
831 command mode (when connected to a remote system).
832 .It Ic flushoutput
833 If
834 .Nm
835 is in
836 .Ic localchars
837 mode (see
838 .Ic toggle
839 .Ic localchars
840 below)
841 and the
842 .Ic flushoutput
843 character is typed, a
844 .Dv TELNET AO
845 sequence (see
846 .Ic send
847 .Ic ao
848 above)
849 is sent to the remote host.
850 The initial value for the flush character is taken to be
851 the terminal's
852 .Ic flush
853 character.
854 .It Ic forw1
855 .It Ic forw2
856 If
857 .Nm
858 is operating in
859 .Dv LINEMODE ,
860 these are the
861 characters that, when typed, cause partial lines to be
862 forwarded to the remote system. The initial value for
863 the forwarding characters are taken from the terminal's
864 eol and eol2 characters.
865 .It Ic interrupt
866 If
867 .Nm
868 is in
869 .Ic localchars
870 mode (see
871 .Ic toggle
872 .Ic localchars
873 below)
874 and the
875 .Ic interrupt
876 character is typed, a
877 .Dv TELNET IP
878 sequence (see
879 .Ic send
880 .Ic ip
881 above)
882 is sent to the remote host.
883 The initial value for the interrupt character is taken to be
884 the terminal's
885 .Ic intr
886 character.
887 .It Ic kill
888 If
889 .Nm
890 is in
891 .Ic localchars
892 mode (see
893 .Ic toggle
894 .Ic localchars
895 below),
896 .Ic and
897 if
898 .Nm
899 is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
900 character is typed, a
901 .Dv TELNET EL
902 sequence (see
903 .Ic send
904 .Ic el
905 above)
906 is sent to the remote system.
907 The initial value for the kill character is taken to be
908 the terminal's
909 .Ic kill
910 character.
911 .It Ic lnext
912 If
913 .Nm
914 is operating in
915 .Dv LINEMODE
916 or \*(Lqold line by line\*(Rq mode, then this character is taken to
917 be the terminal's
918 .Ic lnext
919 character.
920 The initial value for the lnext character is taken to be
921 the terminal's
922 .Ic lnext
923 character.
924 .It Ic quit
925 If
926 .Nm
927 is in
928 .Ic localchars
929 mode (see
930 .Ic toggle
931 .Ic localchars
932 below)
933 and the
934 .Ic quit
935 character is typed, a
936 .Dv TELNET BRK
937 sequence (see
938 .Ic send
939 .Ic brk
940 above)
941 is sent to the remote host.
942 The initial value for the quit character is taken to be
943 the terminal's
944 .Ic quit
945 character.
946 .It Ic reprint
947 If
948 .Nm
949 is operating in
950 .Dv LINEMODE
951 or \*(Lqold line by line\*(Rq mode, then this character is taken to
952 be the terminal's
953 .Ic reprint
954 character.
955 The initial value for the reprint character is taken to be
956 the terminal's
957 .Ic reprint
958 character.
959 .It Ic rlogin
960 This is the rlogin escape character.
961 If set, the normal
962 .Nm
963 escape character is ignored unless it is
964 preceded by this character at the beginning of a line.
965 This character, at the beginning of a line followed by
966 a "." closes the connection; when followed by a ^Z it
967 suspends the
968 .Nm
969 command. The initial state is to
970 disable the
971 .Nm rlogin
972 escape character.
973 .It Ic start
974 If the
975 .Dv TELNET TOGGLE-FLOW-CONTROL
976 option has been enabled,
977 then this character is taken to
978 be the terminal's
979 .Ic start
980 character.
981 The initial value for the start character is taken to be
982 the terminal's
983 .Ic start
984 character.
985 .It Ic stop
986 If the
987 .Dv TELNET TOGGLE-FLOW-CONTROL
988 option has been enabled,
989 then this character is taken to
990 be the terminal's
991 .Ic stop
992 character.
993 The initial value for the stop character is taken to be
994 the terminal's
995 .Ic stop
996 character.
997 .It Ic susp
998 If
999 .Nm
1000 is in
1001 .Ic localchars
1002 mode, or
1003 .Dv LINEMODE
1004 is enabled, and the
1005 .Ic suspend
1006 character is typed, a
1007 .Dv TELNET SUSP
1008 sequence (see
1009 .Ic send
1010 .Ic susp
1011 above)
1012 is sent to the remote host.
1013 The initial value for the suspend character is taken to be
1014 the terminal's
1015 .Ic suspend
1016 character.
1017 .It Ic tracefile
1018 This is the file to which the output, caused by
1019 .Ic netdata
1020 or
1021 .Ic option
1022 tracing being
1023 .Dv TRUE ,
1024 will be written. If it is set to
1025 .Dq Fl ,
1026 then tracing information will be written to standard output (the default).
1027 .It Ic worderase
1028 If
1029 .Nm
1030 is operating in
1031 .Dv LINEMODE
1032 or \*(Lqold line by line\*(Rq mode, then this character is taken to
1033 be the terminal's
1034 .Ic worderase
1035 character.
1036 The initial value for the worderase character is taken to be
1037 the terminal's
1038 .Ic worderase
1039 character.
1040 .It Ic ?\&
1041 Displays the legal
1042 .Ic set
1043 .Pq Ic unset
1044 commands.
1045 .El
1046 .It Ic opie Ar sequence challenge
1047 The
1048 .Ic opie
1049 command computes a response to the OPIE challenge.
1050 .It Ic slc Ar state
1051 The
1052 .Ic slc
1053 command (Set Local Characters) is used to set
1054 or change the state of the special
1055 characters when the
1056 .Dv TELNET LINEMODE
1057 option has
1058 been enabled. Special characters are characters that get
1059 mapped to
1060 .Tn TELNET
1061 commands sequences (like
1062 .Ic ip
1063 or
1064 .Ic quit )
1065 or line editing characters (like
1066 .Ic erase
1067 and
1068 .Ic kill ) .
1069 By default, the local special characters are exported.
1070 .Bl -tag -width Fl
1071 .It Ic check
1072 Verify the current settings for the current special characters.
1073 The remote side is requested to send all the current special
1074 character settings, and if there are any discrepancies with
1075 the local side, the local side will switch to the remote value.
1076 .It Ic export
1077 Switch to the local defaults for the special characters. The
1078 local default characters are those of the local terminal at
1079 the time when
1080 .Nm
1081 was started.
1082 .It Ic import
1083 Switch to the remote defaults for the special characters.
1084 The remote default characters are those of the remote system
1085 at the time when the
1086 .Tn TELNET
1087 connection was established.
1088 .It Ic ?\&
1089 Prints out help information for the
1090 .Ic slc
1091 command.
1092 .El
1093 .It Ic status
1094 Show the current status of
1095 .Nm .
1096 This includes the peer one is connected to, as well
1097 as the current mode.
1098 .It Ic toggle Ar arguments ...
1099 Toggle (between
1100 .Dv TRUE
1101 and
1102 .Dv FALSE )
1103 various flags that control how
1104 .Nm
1105 responds to events.
1106 These flags may be set explicitly to
1107 .Dv TRUE
1108 or
1109 .Dv FALSE
1110 using the
1111 .Ic set
1112 and
1113 .Ic unset
1114 commands listed above.
1115 More than one argument may be specified.
1116 The state of these flags may be interrogated with the
1117 .Ic display
1118 command.
1119 Valid arguments are:
1120 .Bl -tag -width Ar
1121 .It Ic authdebug
1122 Turns on debugging information for the authentication code.
1123 .It Ic autoflush
1124 If
1125 .Ic autoflush
1126 and
1127 .Ic localchars
1128 are both
1129 .Dv TRUE ,
1130 then when the
1131 .Ic ao ,
1132 or
1133 .Ic quit
1134 characters are recognized (and transformed into
1135 .Tn TELNET
1136 sequences; see
1137 .Ic set
1138 above for details),
1139 .Nm
1140 refuses to display any data on the user's terminal
1141 until the remote system acknowledges (via a
1142 .Dv TELNET TIMING MARK
1143 option)
1144 that it has processed those
1145 .Tn TELNET
1146 sequences.
1147 The initial value for this toggle is
1148 .Dv TRUE
1149 if the terminal user had not
1150 done an "stty noflsh", otherwise
1151 .Dv FALSE
1152 (see
1153 .Xr stty 1 ) .
1154 .It Ic autodecrypt
1155 When the
1156 .Dv TELNET ENCRYPT
1157 option is negotiated, by
1158 default the actual encryption (decryption) of the data
1159 stream does not start automatically. The autoencrypt
1160 (autodecrypt) command states that encryption of the
1161 output (input) stream should be enabled as soon as
1162 possible.
1163 .It Ic autologin
1164 If the remote side supports the
1165 .Dv TELNET AUTHENTICATION
1166 option
1167 .Nm
1168 attempts to use it to perform automatic authentication. If the
1169 .Dv AUTHENTICATION
1170 option is not supported, the user's login
1171 name are propagated through the
1172 .Dv TELNET ENVIRON
1173 option.
1174 This command is the same as specifying
1175 .Fl a
1176 option on the
1177 .Ic open
1178 command.
1179 .It Ic autosynch
1180 If
1181 .Ic autosynch
1182 and
1183 .Ic localchars
1184 are both
1185 .Dv TRUE ,
1186 then when either the
1187 .Ic intr
1188 or
1189 .Ic quit
1190 characters is typed (see
1191 .Ic set
1192 above for descriptions of the
1193 .Ic intr
1194 and
1195 .Ic quit
1196 characters), the resulting
1197 .Tn TELNET
1198 sequence sent is followed by the
1199 .Dv TELNET SYNCH
1200 sequence.
1201 This procedure
1202 .Ic should
1203 cause the remote system to begin throwing away all previously
1204 typed input until both of the
1205 .Tn TELNET
1206 sequences have been read and acted upon.
1207 The initial value of this toggle is
1208 .Dv FALSE .
1209 .It Ic binary
1210 Enable or disable the
1211 .Dv TELNET BINARY
1212 option on both input and output.
1213 .It Ic inbinary
1214 Enable or disable the
1215 .Dv TELNET BINARY
1216 option on input.
1217 .It Ic outbinary
1218 Enable or disable the
1219 .Dv TELNET BINARY
1220 option on output.
1221 .It Ic crlf
1222 If this is
1223 .Dv TRUE ,
1224 then carriage returns will be sent as
1225 .Li <CR><LF> .
1226 If this is
1227 .Dv FALSE ,
1228 then carriage returns will be send as
1229 .Li <CR><NUL> .
1230 The initial value for this toggle is
1231 .Dv FALSE .
1232 .It Ic crmod
1233 Toggle carriage return mode.
1234 When this mode is enabled, most carriage return characters received from
1235 the remote host will be mapped into a carriage return followed by
1236 a line feed.
1237 This mode does not affect those characters typed by the user, only
1238 those received from the remote host.
1239 This mode is not very useful unless the remote host
1240 only sends carriage return, but never line feed.
1241 The initial value for this toggle is
1242 .Dv FALSE .
1243 .It Ic debug
1244 Toggles socket level debugging (useful only to the
1245 .Ic super user ) .
1246 The initial value for this toggle is
1247 .Dv FALSE .
1248 .It Ic encdebug
1249 Turns on debugging information for the encryption code.
1250 .It Ic localchars
1251 If this is
1252 .Dv TRUE ,
1253 then the
1254 .Ic flush ,
1255 .Ic interrupt ,
1256 .Ic quit ,
1257 .Ic erase ,
1258 and
1259 .Ic kill
1260 characters (see
1261 .Ic set
1262 above) are recognized locally, and transformed into (hopefully) appropriate
1263 .Tn TELNET
1264 control sequences
1265 (respectively
1266 .Ic ao ,
1267 .Ic ip ,
1268 .Ic brk ,
1269 .Ic ec ,
1270 and
1271 .Ic el ;
1272 see
1273 .Ic send
1274 above).
1275 The initial value for this toggle is
1276 .Dv TRUE
1277 in \*(Lqold line by line\*(Rq mode,
1278 and
1279 .Dv FALSE
1280 in \*(Lqcharacter at a time\*(Rq mode.
1281 When the
1282 .Dv LINEMODE
1283 option is enabled, the value of
1284 .Ic localchars
1285 is ignored, and assumed to always be
1286 .Dv TRUE .
1287 If
1288 .Dv LINEMODE
1289 has ever been enabled, then
1290 .Ic quit
1291 is sent as
1292 .Ic abort ,
1293 and
1294 .Ic eof
1295 and
1296 .Ic suspend
1297 are sent as
1298 .Ic eof
1299 and
1300 .Ic susp
1301 (see
1302 .Ic send
1303 above).
1304 .It Ic netdata
1305 Toggles the display of all network data (in hexadecimal format).
1306 The initial value for this toggle is
1307 .Dv FALSE .
1308 .It Ic options
1309 Toggles the display of some internal
1310 .Nm
1311 protocol processing (having to do with
1312 .Tn TELNET
1313 options).
1314 The initial value for this toggle is
1315 .Dv FALSE .
1316 .It Ic prettydump
1317 When the
1318 .Ic netdata
1319 toggle is enabled, if
1320 .Ic prettydump
1321 is enabled the output from the
1322 .Ic netdata
1323 command will be formatted in a more user readable format.
1324 Spaces are put between each character in the output, and the
1325 beginning of any
1326 .Nm
1327 escape sequence is preceded by a '*' to aid in locating them.
1328 .It Ic skiprc
1329 When the skiprc toggle is
1330 .Dv TRUE ,
1331 .Nm
1332 skips the reading of the
1333 .Pa \&.telnetrc
1334 file in the users home
1335 directory when connections are opened. The initial
1336 value for this toggle is
1337 .Dv FALSE .
1338 .It Ic termdata
1339 Toggles the display of all terminal data (in hexadecimal format).
1340 The initial value for this toggle is
1341 .Dv FALSE .
1342 .It Ic verbose_encrypt
1343 When the
1344 .Ic verbose_encrypt
1345 toggle is
1346 .Dv TRUE ,
1347 .Nm
1348 prints out a message each time encryption is enabled or
1349 disabled. The initial value for this toggle is
1350 .Dv FALSE .
1351 .It Ic ?\&
1352 Displays the legal
1353 .Ic toggle
1354 commands.
1355 .El
1356 .It Ic z
1357 Suspend
1358 .Nm .
1359 This command only works when the user is using the
1360 .Xr csh 1 .
1361 .It Ic \&! Op Ar command
1362 Execute a single command in a subshell on the local
1363 system. If
1364 .Ar command
1365 is omitted, then an interactive
1366 subshell is invoked.
1367 .It Ic ?\& Op Ar command
1368 Get help. With no arguments,
1369 .Nm
1370 prints a help summary.
1371 If
1372 .Ar command
1373 is specified,
1374 .Nm
1375 will print the help information for just that command.
1376 .El
1377 .Sh ENVIRONMENT
1378 .Nm
1379 uses at least the
1380 .Ev HOME ,
1381 .Ev SHELL ,
1382 .Ev DISPLAY ,
1383 and
1384 .Ev TERM
1385 environment variables.
1386 Other environment variables may be propagated
1387 to the other side via the
1388 .Dv TELNET ENVIRON
1389 option.
1390 .Sh SEE ALSO
1391 .Xr rlogin 1 ,
1392 .Xr rsh 1 ,
1393 .Xr hosts 5 ,
1394 .Xr nologin 5 ,
1395 .Xr telnetd 8
1396 .Sh FILES
1397 .Bl -tag -width ~/.telnetrc -compact
1398 .It Pa ~/.telnetrc
1399 user customized telnet startup values
1400 .El
1401 .Sh HISTORY
1402 The
1403 .Nm
1404 command appeared in
1405 .Bx 4.2 .
1406 .Pp
1407 IPv6 support was added by WIDE/KAME project.
1408 .Sh NOTES
1409 On some remote systems, echo has to be turned off manually when in
1410 \*(Lqold line by line\*(Rq mode.
1411 .Pp
1412 In \*(Lqold line by line\*(Rq mode or
1413 .Dv LINEMODE
1414 the terminal's
1415 .Ic eof
1416 character is only recognized (and sent to the remote system)
1417 when it is the first character on a line.