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