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