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