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