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