Annotation of src/usr.bin/telnet/telnet.1, Revision 1.63
1.63 ! schwarze 1: .\" $OpenBSD: telnet.1,v 1.62 2015/11/13 21:09:18 jmc 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.61 jmc 42: .Op Fl 4678acDEKLr
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
1.63 ! schwarze 614: system \(em if it doesn't work, a lower case
1.54 bentley 615: .Sq r
616: may be echoed on the terminal).
1.1 deraadt 617: .It Ic do Ar cmd
1.12 aaron 618: Sends the
619: .Dv TELNET DO
620: .Ar cmd
621: sequence.
622: .Ar cmd
623: can be either a decimal number between 0 and 255,
1.46 schwarze 624: or a symbolic name for a specific TELNET command.
1.12 aaron 625: .Ar cmd
626: can also be either
627: .Ic help
628: or
1.35 jmc 629: .Ic ?\&
1.12 aaron 630: to print out help information, including
631: a list of known symbolic names.
1.1 deraadt 632: .It Ic dont Ar cmd
1.12 aaron 633: Sends the
634: .Dv TELNET DONT
635: .Ar cmd
636: sequence.
637: .Ar cmd
638: can be either a decimal number between 0 and 255,
1.46 schwarze 639: or a symbolic name for a specific TELNET command.
1.12 aaron 640: .Ar cmd
641: can also be either
642: .Ic help
643: or
1.35 jmc 644: .Ic ?\&
1.12 aaron 645: to print out help information, including
646: a list of known symbolic names.
1.1 deraadt 647: .It Ic will Ar cmd
1.12 aaron 648: Sends the
649: .Dv TELNET WILL
650: .Ar cmd
651: sequence.
652: .Ar cmd
653: can be either a decimal number between 0 and 255,
1.46 schwarze 654: or a symbolic name for a specific TELNET command.
1.12 aaron 655: .Ar cmd
656: can also be either
657: .Ic help
658: or
1.35 jmc 659: .Ic ?\&
1.12 aaron 660: to print out help information, including
661: a list of known symbolic names.
1.1 deraadt 662: .It Ic wont Ar cmd
663: Sends the
1.12 aaron 664: .Dv TELNET WONT
1.1 deraadt 665: .Ar cmd
666: sequence.
1.12 aaron 667: .Ar cmd
1.1 deraadt 668: can be either a decimal number between 0 and 255,
1.46 schwarze 669: or a symbolic name for a specific TELNET command.
1.12 aaron 670: .Ar cmd
1.1 deraadt 671: can also be either
672: .Ic help
673: or
1.35 jmc 674: .Ic ?\&
1.1 deraadt 675: to print out help information, including
676: a list of known symbolic names.
677: .It Ic \&?
678: Prints out help information for the
679: .Ic send
680: command.
681: .El
1.16 aaron 682: .It Ic set Ar argument value
683: .It Ic unset Ar argument value
1.1 deraadt 684: The
685: .Ic set
686: command will set any one of a number of
1.22 aaron 687: .Nm
1.1 deraadt 688: variables to a specific value or to
689: .Dv TRUE .
690: The special value
691: .Ic off
692: turns off the function associated with
1.12 aaron 693: the variable; this is equivalent to using the
1.1 deraadt 694: .Ic unset
695: command.
696: The
697: .Ic unset
698: command will disable or set to
699: .Dv FALSE
700: any of the specified functions.
701: The values of variables may be interrogated with the
702: .Ic display
703: command.
704: The variables which may be set or unset, but not toggled, are
1.22 aaron 705: listed here.
706: In addition, any of the variables for the
1.1 deraadt 707: .Ic toggle
708: command may be explicitly set or unset using
709: the
710: .Ic set
711: and
712: .Ic unset
713: commands.
714: .Bl -tag -width escape
715: .It Ic ayt
1.46 schwarze 716: If TELNET is in
1.12 aaron 717: .Ic localchars
718: mode, or
1.1 deraadt 719: .Dv LINEMODE
720: is enabled, and the status character is typed, a
721: .Dv TELNET AYT
722: sequence (see
723: .Ic send ayt
724: preceding) is sent to the
1.22 aaron 725: remote host.
726: The initial value for the "Are You There"
1.1 deraadt 727: character is the terminal's status character.
728: .It Ic echo
1.54 bentley 729: This is the value
730: .Pq initially Sq ^E
731: which, when in
732: .Dq line by line
733: mode, toggles between doing local echoing
1.1 deraadt 734: of entered characters (for normal processing), and suppressing
735: echoing of entered characters (for entering, say, a password).
736: .It Ic eof
737: If
1.22 aaron 738: .Nm
1.1 deraadt 739: is operating in
740: .Dv LINEMODE
1.54 bentley 741: or
742: .Dq old line by line
743: mode, entering this character
1.1 deraadt 744: as the first character on a line will cause this character to be
745: sent to the remote system.
1.12 aaron 746: The initial value of the
747: .Ic eof
748: character is taken to be the terminal's
1.1 deraadt 749: .Ic eof
750: character.
751: .It Ic erase
752: If
1.22 aaron 753: .Nm
1.1 deraadt 754: is in
755: .Ic localchars
756: mode (see
757: .Ic toggle
758: .Ic localchars
759: below),
1.12 aaron 760: and if
1.22 aaron 761: .Nm
1.54 bentley 762: is operating in
763: .Dq character at a time
764: mode, then when this character is typed, a
1.1 deraadt 765: .Dv TELNET EC
766: sequence (see
767: .Ic send
768: .Ic ec
769: above)
770: is sent to the remote system.
1.12 aaron 771: The initial value for the
772: .Ic erase
773: character is taken to be
1.1 deraadt 774: the terminal's
775: .Ic erase
776: character.
777: .It Ic escape
778: This is the
1.22 aaron 779: .Nm
1.54 bentley 780: escape character
781: .Pq initially Sq ^[
782: which causes entry into
1.22 aaron 783: .Nm
1.1 deraadt 784: command mode (when connected to a remote system).
785: .It Ic flushoutput
786: If
1.22 aaron 787: .Nm
1.1 deraadt 788: is in
789: .Ic localchars
790: mode (see
791: .Ic toggle
792: .Ic localchars
793: below)
794: and the
795: .Ic flushoutput
796: character is typed, a
797: .Dv TELNET AO
798: sequence (see
799: .Ic send
800: .Ic ao
801: above)
802: is sent to the remote host.
1.12 aaron 803: The initial value for the
804: .Ic flush
805: character is taken to be
1.1 deraadt 806: the terminal's
807: .Ic flush
808: character.
809: .It Ic forw1
810: .It Ic forw2
1.46 schwarze 811: If TELNET is operating in
1.1 deraadt 812: .Dv LINEMODE ,
813: these are the
814: characters that, when typed, cause partial lines to be
1.22 aaron 815: forwarded to the remote system.
816: The initial value for
1.1 deraadt 817: the forwarding characters are taken from the terminal's
818: eol and eol2 characters.
819: .It Ic interrupt
820: If
1.22 aaron 821: .Nm
1.1 deraadt 822: is in
823: .Ic localchars
824: mode (see
825: .Ic toggle
826: .Ic localchars
827: below)
828: and the
829: .Ic interrupt
830: character is typed, a
831: .Dv TELNET IP
832: sequence (see
833: .Ic send
834: .Ic ip
835: above)
836: is sent to the remote host.
1.12 aaron 837: The initial value for the
838: .Ic interrupt
839: character is taken to be
1.1 deraadt 840: the terminal's
841: .Ic intr
842: character.
843: .It Ic kill
844: If
1.22 aaron 845: .Nm
1.1 deraadt 846: is in
847: .Ic localchars
848: mode (see
849: .Ic toggle
850: .Ic localchars
851: below),
1.12 aaron 852: and if
1.22 aaron 853: .Nm
1.54 bentley 854: is operating in
855: .Dq character at a time
856: mode, then when this character is typed, a
1.1 deraadt 857: .Dv TELNET EL
858: sequence (see
859: .Ic send
860: .Ic el
861: above)
862: is sent to the remote system.
1.12 aaron 863: The initial value for the
864: .Ic kill
865: character is taken to be
1.1 deraadt 866: the terminal's
867: .Ic kill
868: character.
869: .It Ic lnext
870: If
1.22 aaron 871: .Nm
1.1 deraadt 872: is operating in
873: .Dv LINEMODE
1.54 bentley 874: or
875: .Dq old line by line
876: mode, then this character is taken to be the terminal's
1.1 deraadt 877: .Ic lnext
878: character.
1.12 aaron 879: The initial value for the
880: .Ic lnext
881: character is taken to be
1.1 deraadt 882: the terminal's
883: .Ic lnext
884: character.
885: .It Ic quit
886: If
1.22 aaron 887: .Nm
1.1 deraadt 888: is in
889: .Ic localchars
890: mode (see
891: .Ic toggle
892: .Ic localchars
893: below)
894: and the
895: .Ic quit
896: character is typed, a
897: .Dv TELNET BRK
898: sequence (see
899: .Ic send
900: .Ic brk
901: above)
902: is sent to the remote host.
1.12 aaron 903: The initial value for the
904: .Ic quit
905: character is taken to be
1.1 deraadt 906: the terminal's
907: .Ic quit
908: character.
909: .It Ic reprint
910: If
1.22 aaron 911: .Nm
1.1 deraadt 912: is operating in
913: .Dv LINEMODE
1.54 bentley 914: or
915: .Dq old line by line
916: mode, then this character is taken to be the terminal's
1.1 deraadt 917: .Ic reprint
918: character.
1.12 aaron 919: The initial value for the
920: .Ic reprint
921: character is taken to be
1.1 deraadt 922: the terminal's
923: .Ic reprint
924: character.
925: .It Ic rlogin
926: This is the rlogin escape character.
1.46 schwarze 927: If set, the normal TELNET
1.1 deraadt 928: escape character is ignored unless it is
929: preceded by this character at the beginning of a line.
1.12 aaron 930: This character, at the beginning of a line, followed by
931: a "." closes the connection; when followed by a ^Z it
1.5 deraadt 932: suspends the
1.22 aaron 933: .Nm
934: command.
935: The initial state is to
1.12 aaron 936: disable the
937: .Ic rlogin
938: escape character.
1.1 deraadt 939: .It Ic start
940: If the
941: .Dv TELNET TOGGLE-FLOW-CONTROL
942: option has been enabled,
943: then this character is taken to
944: be the terminal's
945: .Ic start
946: character.
1.12 aaron 947: The initial value for the
948: .Ic start
949: character is taken to be
1.1 deraadt 950: the terminal's
951: .Ic start
952: character.
953: .It Ic stop
954: If the
955: .Dv TELNET TOGGLE-FLOW-CONTROL
956: option has been enabled,
957: then this character is taken to
958: be the terminal's
959: .Ic stop
960: character.
1.12 aaron 961: The initial value for the
962: .Ic stop
963: character is taken to be
1.1 deraadt 964: the terminal's
965: .Ic stop
966: character.
967: .It Ic susp
968: If
1.22 aaron 969: .Nm
1.1 deraadt 970: is in
971: .Ic localchars
972: mode, or
973: .Dv LINEMODE
974: is enabled, and the
975: .Ic suspend
976: character is typed, a
977: .Dv TELNET SUSP
978: sequence (see
979: .Ic send
980: .Ic susp
981: above)
982: is sent to the remote host.
1.12 aaron 983: The initial value for the
984: .Ic suspend
985: character is taken to be
1.1 deraadt 986: the terminal's
987: .Ic suspend
988: character.
989: .It Ic worderase
990: If
1.22 aaron 991: .Nm
1.1 deraadt 992: is operating in
993: .Dv LINEMODE
1.54 bentley 994: or
995: .Dq old line by line
996: mode, then this character is taken to be the terminal's
1.1 deraadt 997: .Ic worderase
998: character.
1.12 aaron 999: The initial value for the
1000: .Ic worderase
1001: character is taken to be
1.1 deraadt 1002: the terminal's
1003: .Ic worderase
1004: character.
1005: .It Ic \&?
1006: Displays the legal
1007: .Ic set
1008: .Pq Ic unset
1009: commands.
1010: .El
1.16 aaron 1011: .It Ic slc Ar state
1.1 deraadt 1012: The
1013: .Ic slc
1014: command (Set Local Characters) is used to set
1.4 deraadt 1015: or change the state of the special
1.16 aaron 1016: characters when the
1.1 deraadt 1017: .Dv TELNET LINEMODE
1018: option has
1.22 aaron 1019: been enabled.
1.46 schwarze 1020: Special characters are characters that get mapped to TELNET
1.1 deraadt 1021: commands sequences (like
1022: .Ic ip
1023: or
1.22 aaron 1024: .Ic quit )
1.1 deraadt 1025: or line editing characters (like
1026: .Ic erase
1027: and
1.22 aaron 1028: .Ic kill ) .
1.1 deraadt 1029: By default, the local special characters are exported.
1030: .Bl -tag -width Fl
1031: .It Ic check
1032: Verify the current settings for the current special characters.
1033: The remote side is requested to send all the current special
1034: character settings, and if there are any discrepancies with
1035: the local side, the local side will switch to the remote value.
1036: .It Ic export
1.22 aaron 1037: Switch to the local defaults for the special characters.
1038: The local default characters are those of the local terminal at
1.1 deraadt 1039: the time when
1.22 aaron 1040: .Nm
1.1 deraadt 1041: was started.
1042: .It Ic import
1043: Switch to the remote defaults for the special characters.
1044: The remote default characters are those of the remote system
1.46 schwarze 1045: at the time when the TELNET connection was established.
1.1 deraadt 1046: .It Ic \&?
1047: Prints out help information for the
1048: .Ic slc
1049: command.
1050: .El
1051: .It Ic status
1052: Show the current status of
1.12 aaron 1053: .Nm telnet .
1.1 deraadt 1054: This includes the peer one is connected to, as well
1055: as the current mode.
1.40 sobrado 1056: .It Ic toggle Ar argument ...
1.1 deraadt 1057: Toggle (between
1058: .Dv TRUE
1059: and
1060: .Dv FALSE )
1061: various flags that control how
1.22 aaron 1062: .Nm
1.1 deraadt 1063: responds to events.
1064: These flags may be set explicitly to
1065: .Dv TRUE
1066: or
1067: .Dv FALSE
1068: using the
1069: .Ic set
1070: and
1071: .Ic unset
1072: commands listed above.
1073: More than one argument may be specified.
1074: The state of these flags may be interrogated with the
1075: .Ic display
1076: command.
1077: Valid arguments are:
1078: .Bl -tag -width Ar
1079: .It Ic autoflush
1080: If
1081: .Ic autoflush
1082: and
1083: .Ic localchars
1084: are both
1085: .Dv TRUE ,
1086: then when the
1.12 aaron 1087: .Ic ao
1.1 deraadt 1088: or
1089: .Ic quit
1.46 schwarze 1090: characters are recognized (and transformed into TELNET sequences; see
1.1 deraadt 1091: .Ic set
1092: above for details),
1.22 aaron 1093: .Nm
1.1 deraadt 1094: refuses to display any data on the user's terminal
1095: until the remote system acknowledges (via a
1096: .Dv TELNET TIMING MARK
1097: option)
1.46 schwarze 1098: that it has processed those TELNET sequences.
1.1 deraadt 1099: The initial value for this toggle is
1100: .Dv TRUE
1101: if the terminal user had not
1102: done an "stty noflsh", otherwise
1103: .Dv FALSE
1104: (see
1.22 aaron 1105: .Xr stty 1 ) .
1.1 deraadt 1106: .It Ic autologin
1.50 guenther 1107: The user's login
1.31 deraadt 1108: name is propagated through the
1.1 deraadt 1109: .Dv TELNET ENVIRON
1110: option.
1111: This command is the same as specifying
1112: .Ar a
1113: option on the
1114: .Ic open
1115: command.
1116: .It Ic autosynch
1117: If
1118: .Ic autosynch
1119: and
1120: .Ic localchars
1121: are both
1122: .Dv TRUE ,
1123: then when either the
1124: .Ic intr
1125: or
1126: .Ic quit
1.12 aaron 1127: character is typed (see
1.1 deraadt 1128: .Ic set
1129: above for descriptions of the
1130: .Ic intr
1131: and
1132: .Ic quit
1.46 schwarze 1133: characters), the resulting TELNET sequence sent is followed by the
1.1 deraadt 1134: .Dv TELNET SYNCH
1135: sequence.
1136: This procedure
1.12 aaron 1137: .Em should
1.1 deraadt 1138: cause the remote system to begin throwing away all previously
1.46 schwarze 1139: typed input until both of the TELNET
1.1 deraadt 1140: sequences have been read and acted upon.
1141: The initial value of this toggle is
1142: .Dv FALSE .
1143: .It Ic binary
1144: Enable or disable the
1145: .Dv TELNET BINARY
1146: option on both input and output.
1147: .It Ic inbinary
1148: Enable or disable the
1149: .Dv TELNET BINARY
1150: option on input.
1151: .It Ic outbinary
1152: Enable or disable the
1153: .Dv TELNET BINARY
1154: option on output.
1155: .It Ic crlf
1156: If this is
1157: .Dv TRUE ,
1158: then carriage returns will be sent as
1159: .Li <CR><LF> .
1160: If this is
1161: .Dv FALSE ,
1.31 deraadt 1162: then carriage returns will be sent as
1.1 deraadt 1163: .Li <CR><NUL> .
1164: The initial value for this toggle is
1165: .Dv FALSE .
1166: .It Ic crmod
1167: Toggle carriage return mode.
1168: When this mode is enabled, most carriage return characters received from
1169: the remote host will be mapped into a carriage return followed by
1170: a line feed.
1171: This mode does not affect those characters typed by the user, only
1172: those received from the remote host.
1173: This mode is not very useful unless the remote host
1.12 aaron 1174: only sends carriage return, but never line feeds.
1.1 deraadt 1175: The initial value for this toggle is
1176: .Dv FALSE .
1177: .It Ic localchars
1178: If this is
1179: .Dv TRUE ,
1180: then the
1.12 aaron 1181: .Ic flush ,
1.1 deraadt 1182: .Ic interrupt ,
1.12 aaron 1183: .Ic quit ,
1.1 deraadt 1184: .Ic erase ,
1185: and
1186: .Ic kill
1187: characters (see
1188: .Ic set
1189: above) are recognized locally, and transformed into (hopefully) appropriate
1.46 schwarze 1190: TELNET control sequences
1.1 deraadt 1191: (respectively
1.12 aaron 1192: .Ic ao ,
1.1 deraadt 1193: .Ic ip ,
1.12 aaron 1194: .Ic brk ,
1.1 deraadt 1195: .Ic ec ,
1196: and
1.22 aaron 1197: .Ic el ;
1.1 deraadt 1198: see
1199: .Ic send
1200: above).
1201: The initial value for this toggle is
1202: .Dv TRUE
1.54 bentley 1203: in
1204: .Dq old line by line
1205: mode, and
1.1 deraadt 1206: .Dv FALSE
1.54 bentley 1207: in
1208: .Dq character at a time
1209: mode.
1.1 deraadt 1210: When the
1211: .Dv LINEMODE
1212: option is enabled, the value of
1213: .Ic localchars
1214: is ignored, and assumed to always be
1215: .Dv TRUE .
1216: If
1217: .Dv LINEMODE
1218: has ever been enabled, then
1219: .Ic quit
1220: is sent as
1.12 aaron 1221: .Ic abort ,
1222: and
1223: .Ic eof
1.1 deraadt 1224: and
1.5 deraadt 1225: .Ic suspend
1.1 deraadt 1226: are sent as
1.12 aaron 1227: .Ic eof
1228: and
1.5 deraadt 1229: .Ic susp
1230: (see
1.1 deraadt 1231: .Ic send
1232: above).
1233: .It Ic netdata
1234: Toggles the display of all network data (in hexadecimal format).
1235: The initial value for this toggle is
1236: .Dv FALSE .
1237: .It Ic options
1238: Toggles the display of some internal
1.22 aaron 1239: .Nm
1.46 schwarze 1240: protocol processing (having to do with TELNET options).
1.1 deraadt 1241: The initial value for this toggle is
1242: .Dv FALSE .
1243: .It Ic prettydump
1244: When the
1245: .Ic netdata
1246: toggle is enabled, if
1247: .Ic prettydump
1248: is enabled the output from the
1249: .Ic netdata
1250: command will be formatted in a more user readable format.
1251: Spaces are put between each character in the output, and the
1.46 schwarze 1252: beginning of any TELNET
1.1 deraadt 1253: escape sequence is preceded by a '*' to aid in locating them.
1254: .It Ic skiprc
1255: When the skiprc toggle is
1256: .Dv TRUE ,
1.46 schwarze 1257: TELNET skips the reading of the
1.1 deraadt 1258: .Pa \&.telnetrc
1.12 aaron 1259: file in the user's home
1.22 aaron 1260: directory when connections are opened.
1261: The initial value for this toggle is
1.13 aaron 1262: .Dv FALSE .
1.1 deraadt 1263: .It Ic termdata
1264: Toggles the display of all terminal data (in hexadecimal format).
1265: The initial value for this toggle is
1266: .Dv FALSE .
1267: .It Ic \&?
1268: Displays the legal
1269: .Ic toggle
1270: commands.
1271: .El
1272: .It Ic z
1273: Suspend
1.12 aaron 1274: .Nm telnet .
1.51 guenther 1275: This command only works when the user is using a shell with
1276: job control enabled.
1.16 aaron 1277: .It Ic \&? Op Ar command
1.22 aaron 1278: Get help.
1279: With no arguments,
1280: .Nm
1.1 deraadt 1281: prints a help summary.
1282: If a command is specified,
1.22 aaron 1283: .Nm
1.1 deraadt 1284: will print the help information for just that command.
1285: .El
1286: .Sh ENVIRONMENT
1.22 aaron 1287: .Nm
1.1 deraadt 1288: uses at least the
1289: .Ev HOME ,
1290: .Ev DISPLAY ,
1291: and
1292: .Ev TERM
1293: environment variables.
1294: Other environment variables may be propagated
1295: to the other side via the
1296: .Dv TELNET ENVIRON
1297: option.
1298: .Sh FILES
1299: .Bl -tag -width ~/.telnetrc -compact
1300: .It Pa ~/.telnetrc
1301: user customized telnet startup values
1302: .El
1.44 lum 1303: .Sh SEE ALSO
1.53 guenther 1304: .Xr ssh 1 ,
1305: .Xr stty 1
1.1 deraadt 1306: .Sh HISTORY
1307: The
1.22 aaron 1308: .Nm
1.1 deraadt 1309: command appeared in
1310: .Bx 4.2 .
1311: .Sh NOTES
1312: On some remote systems, echo has to be turned off manually when in
1.54 bentley 1313: .Dq old line by line
1314: mode.
1.1 deraadt 1315: .Pp
1.54 bentley 1316: In
1317: .Dq old line by line
1318: mode or
1.1 deraadt 1319: .Dv LINEMODE
1320: the terminal's
1321: .Ic eof
1322: character is only recognized (and sent to the remote system)
1323: when it is the first character on a line.