1 .\" $NetBSD: telnet.1,v 1.30 2004/03/20 23:10:01 heas Exp $
3 .\" Copyright (c) 1983, 1990, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" from: @(#)telnet.1 8.4 (Berkeley) 2/3/94
37 .Nd user interface to the
60 .Op Fl e Ar escapechar
85 is used to communicate with another host using the
90 is invoked without the
92 argument, it enters command mode,
93 indicated by its prompt
94 .Pq Nm telnet\&\*[Gt] .
95 In this mode, it accepts and executes the commands listed below.
96 If it is invoked with arguments, it performs an
98 command with those arguments.
101 .Bl -tag -width indent
105 to use IPv4 addresses only.
109 to use IPv6 addresses only.
111 Specifies an 8-bit data path.
112 This causes an attempt to
115 option on both input and output.
117 Stops any character from being recognized as an escape character.
119 If Kerberos V5 authentication is being used, the
121 option allows the local credentials to be forwarded
122 to the remote system, including any credentials that
123 have already been forwarded into the local environment.
125 Specifies no automatic login to the remote system.
127 Specifies an 8-bit data path on output.
129 BINARY option to be negotiated on output.
131 Numeric host address.
132 No attempt will be made to look up
133 symbolic names for host addresses.
135 Sets the IP type-of-service (TOS) option for the telnet
136 connection to the value
138 which can be a numeric TOS value
139 or, on systems that support it, a symbolic
140 TOS name found in the /etc/iptos file.
144 type of authentication.
146 Attempt automatic login.
147 Currently, this sends the user name via the
152 option if supported by the remote system.
153 The name used is that of the current user as returned by
155 if it agrees with the current user ID,
156 otherwise it is the name associated with the user ID.
158 Disables the reading of the user's
163 command on this man page.)
165 Sets the initial value of the
169 .It Fl e Ar escape char
177 there will be no escape character.
179 If Kerberos V5 authentication is being used, the
181 option allows the local credentials to be forwarded to the remote system.
183 If Kerberos authentication is being used, the
185 option requests that telnet obtain tickets for the remote host in
188 instead of the remote host's realm, as determined by
189 .Xr krb_realmofhost 3 .
191 When connecting to the remote system, if the remote system
196 will be sent to the remote system as the value for the variable USER.
197 This option implies the
200 This option may also be used with the
203 .It Fl n Ar tracefile
206 for recording trace information.
211 Use IPsec policy specification string
215 .Xr ipsec_set_policy 3
218 Specifies a user interface similar to
221 mode, the escape character is set to the tilde (~) character,
222 unless modified by the
226 Turns on encryption of the data stream if possible.
228 option is not available outside of the United States and
231 Indicates the official name, an alias, or the Internet address
234 Indicates a port number (address of an application).
236 not specified, the default
241 When in rlogin mode, a line of the form ~.
243 remote host; ~ is the telnet escape character.
244 Similarly, the line ~^Z suspends the telnet session.
245 The line ~^] escapes to the normal telnet escape prompt.
247 Once a connection has been opened,
249 will attempt to enable the
254 will revert to one of two input modes:
255 either \*(Lqcharacter at a time\*(Rq
256 or \*(Lqold line by line\*(Rq
257 depending on what the remote system supports.
261 is enabled, character processing is done on the
262 local system, under the control of the remote system.
264 editing or character echoing is to be disabled, the remote system
265 will relay that information.
266 The remote system will also relay
267 changes to any special characters that happen on the remote
268 system, so that they can take effect on the local system.
270 In \*(Lqcharacter at a time\*(Rq mode, most
271 text typed is immediately sent to the remote host for processing.
273 In \*(Lqold line by line\*(Rq mode, all text is echoed locally,
274 and (normally) only completed lines are sent to the remote host.
275 The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used
276 to turn off and on the local echo
277 (this would mostly be used to enter passwords
278 without the password being echoed).
282 option is enabled, or if the
286 (the default for \*(Lqold line by line\*(Lq; see below),
292 characters are trapped locally, and sent as
294 protocol sequences to the remote side.
297 has ever been enabled, then the user's
310 There are options (see
317 which cause this action to flush subsequent output to the terminal
318 (until the remote host acknowledges the
320 sequence) and flush previous terminal input
326 While connected to a remote host,
328 command mode may be entered by typing the
330 \*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq).
331 When in command mode, the normal terminal editing conventions are available.
335 commands are available.
336 Only enough of each command to uniquely identify it need be typed
337 (this is also true for arguments to the
348 .Bl -tag -width "mode type"
349 .It Ic auth Ar argument ...
350 The auth command manipulates the information sent through the
351 .Dv TELNET AUTHENTICATE
353 Valid arguments for the
354 auth command are as follows:
355 .Bl -tag -width "disable type"
356 .It Ic disable Ar type
357 Disables the specified type of authentication.
358 To obtain a list of available types, use the
361 .It Ic enable Ar type
362 Enables the specified type of authentication.
363 To obtain a list of available types, use the
367 Lists the current status of the various types of
373 session and return to command mode.
374 .It Ic display Ar argument ...
375 Displays all, or some, of the
380 .It Ic encrypt Ar argument ...
381 The encrypt command manipulates the information sent through the
385 Note: Because of export controls, the
387 option is not supported outside of the United States and Canada.
389 Valid arguments for the encrypt command are:
391 .It Ic disable Ar type Ic [input|output]
392 Disables the specified type of encryption.
393 If you omit the input and output, both input and output
395 To obtain a list of available types, use the
396 .Ic encrypt disable \&?
398 .It Ic enable Ar type Ic [input|output]
399 Enables the specified type of encryption.
400 If you omit input and output, both input and output are
402 To obtain a list of available types, use the
403 .Ic encrypt enable \&?
406 This is the same as the
407 .Ic encrypt start input
410 This is the same as the
411 .Ic encrypt stop input
414 This is the same as the
415 .Ic encrypt start output
418 This is the same as the
419 .Ic encrypt stop output
421 .It Ic start Ic [input|output]
422 Attempts to start encryption.
427 both input and output are enabled.
428 To obtain a list of available types, use the
429 .Ic encrypt enable \&?
432 Lists the current status of encryption.
433 .It Ic stop Ic [input|output]
435 If you omit input and output,
436 encryption is on both input and output.
438 Sets the default type of encryption to be used
445 .It Ic environ Ar arguments ...
448 command is used to manipulate the
449 variables that may be sent through the
452 The initial set of variables is taken from the users
453 environment, with only the
457 variables being exported by default.
460 variable is also exported if the
466 Valid arguments for the
470 .It Ic define Ar variable value
475 Any variables defined by this command are automatically exported.
478 may be enclosed in single or double quotes so
479 that tabs and spaces may be included.
480 .It Ic undefine Ar variable
483 from the list of environment variables.
484 .It Ic export Ar variable
487 to be exported to the remote side.
488 .It Ic unexport Ar variable
491 to not be exported unless
492 explicitly asked for by the remote side.
494 List the current set of environment variables.
497 will be sent automatically,
498 other variables will only be sent if explicitly requested.
500 Prints out help information for the
507 option to the remote side.
508 This command is similar to a
510 command; however, if the remote side does not support the
512 option, nothing happens.
513 If, however, the remote side does support the
515 option, this command should cause the remote side to close the
518 If the remote side also supports the concept of
519 suspending a user's session for later reattachment,
520 the logout argument indicates that you
521 should terminate the session immediately.
524 is one of several options, depending on the state of the
527 The remote host is asked for permission to go into the requested mode.
528 If the remote host is capable of entering that mode, the requested
529 mode will be entered.
534 option, or, if the remote side does not understand the
536 option, then enter \*(Lqcharacter at a time\*(Lq mode.
540 option, or, if the remote side does not understand the
542 option, then attempt to enter \*(Lqold-line-by-line\*(Lq mode.
543 .It Ic isig Pq Ic \-isig
544 Attempt to enable (disable) the
549 This requires that the
552 .It Ic edit Pq Ic \-edit
553 Attempt to enable (disable) the
558 This requires that the
561 .It Ic softtabs Pq Ic \-softtabs
562 Attempt to enable (disable) the
567 This requires that the
570 .It Ic litecho Pq Ic \-litecho
571 Attempt to enable (disable) the
576 This requires that the
580 Prints out help information for the
584 .It Ic open Ar host Oo Fl l Ar user Oc Oo Fl a Oc Oo Oo \&- Oc Ns Ar port Oc
585 Open a connection to the named host.
589 will attempt to contact a
591 server at the default port.
592 The host specification may be either a host name (see
594 or an Internet address specified in the \*(Lqdot notation\*(Rq (see
598 option may be used to specify the user name
599 to be passed to the remote system via the
602 If a port is specified
604 omits any automatic initialisation of
607 When the port number is preceded by a minus sign,
608 the initial option negotiation is done.
610 After establishing a connection, the file
613 user's home directory is read.
614 Lines beginning with a # are
616 Blank lines are ignored.
618 without white space are the start of a machine entry.
619 The first thing on such a line is a string identifying the machine
620 that is being connected to.
621 It may be the hostname or numeric address specified as the argument
623 the canonical name of that string as determined by
627 indicating all hosts.
628 The rest of the line, and successive
629 lines that begin with white space are assumed to be
631 commands and are processed as if they had been typed
640 An end of file (in command mode) will also close a session and exit.
641 .It Ic send Ar arguments
642 Sends one or more special character sequences to the remote host.
643 The following are the arguments which may be specified
644 (more than one argument may be specified at a time):
646 .Bl -tag -width escape
656 (Abort Output) sequence, which should cause the remote system to flush
666 sequence, to which the remote system may or may not choose to respond.
670 (Break) sequence, which may have significance to the remote
676 sequence, which should cause the remote system to erase the last character
682 sequence, which should cause the remote system to erase the line currently
697 escape character (initially \*(Lq^\*(Rq).
702 sequence, which likely has no significance to the remote system.
704 If the remote side supports the
708 will send the subnegotiation to request that the server send
709 its current option status.
713 (Interrupt Process) sequence, which should cause the remote
714 system to abort the currently running process.
729 This sequence causes the remote system to discard all previously typed
730 (but not yet read) input.
731 This sequence is sent as
734 data (and may not work if the remote system is a
737 it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
747 can be either a decimal number between 0 and 255,
748 or a symbolic name for a specific
756 to print out help information, including
757 a list of known symbolic names.
759 Prints out help information for the
763 .It Ic set Ar argument value
764 .It Ic unset Ar argument value
767 command will set any one of a number of
769 variables to a specific value or to
773 turns off the function associated with
774 the variable, this is equivalent to using the
779 command will disable or set to
781 any of the specified functions.
782 The values of variables may be interrogated with the
785 The variables which may be set or unset, but not toggled, are
787 In addition, any of the variables for the
789 command may be explicitly set or unset using
795 .Bl -tag -width escape
799 is in localchars mode, or
801 is enabled, and the status character is typed, a
805 above) is sent to the
807 The initial value for the "Are You There"
808 character is the terminal's status character.
810 This is the value (initially \*(Lq^E\*(Rq) which, when in
811 \*(Lqline by line\*(Rq mode, toggles between doing local echoing
812 of entered characters (for normal processing), and suppressing
813 echoing of entered characters (for entering, say, a password).
819 or \*(Lqold line by line\*(Rq mode, entering this character
820 as the first character on a line will cause this character to be
821 sent to the remote system.
822 The initial value of the eof character is taken to be the terminal's
837 is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
838 character is typed, a
844 is sent to the remote system.
845 The initial value for the erase character is taken to be
852 escape character (initially \*(Lq^[\*(Rq) which causes entry
855 command mode (when connected to a remote system).
867 character is typed, a
873 is sent to the remote host.
874 The initial value for the flush character is taken to be
885 characters that, when typed, cause partial lines to be
886 forwarded to the remote system.
887 The initial value for
888 the forwarding characters are taken from the terminal's
889 eol and eol2 characters.
901 character is typed, a
907 is sent to the remote host.
908 The initial value for the interrupt character is taken to be
924 is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
925 character is typed, a
931 is sent to the remote system.
932 The initial value for the kill character is taken to be
941 or \*(Lqold line by line\*(Lq mode, then this character is taken to
945 The initial value for the lnext character is taken to be
960 character is typed, a
966 is sent to the remote host.
967 The initial value for the quit character is taken to be
976 or \*(Lqold line by line\*(Lq mode, then this character is taken to
980 The initial value for the reprint character is taken to be
985 This is the rlogin escape character.
988 escape character is ignored unless it is
989 preceded by this character at the beginning of a line.
990 This character, at the beginning of a line followed by
991 a "." closes the connection; when followed by a ^Z it
995 The initial state is to
996 disable the rlogin escape character.
999 .Dv TELNET TOGGLE-FLOW-CONTROL
1000 option has been enabled,
1001 then this character is taken to
1005 The initial value for the start character is taken to be
1011 .Dv TELNET TOGGLE-FLOW-CONTROL
1012 option has been enabled,
1013 then this character is taken to
1017 The initial value for the stop character is taken to be
1030 character is typed, a
1036 is sent to the remote host.
1037 The initial value for the suspend character is taken to be
1042 This is the file to which the output, caused by
1051 then tracing information will be written to standard output (the default).
1057 or \*(Lqold line by line\*(Lq mode, then this character is taken to
1061 The initial value for the worderase character is taken to be
1074 command (Set Local Characters) is used to set
1075 or change the state of the special
1080 Special characters are characters that get
1083 commands sequences (like
1087 or line editing characters (like
1091 By default, the local special characters are exported.
1094 Verify the current settings for the current special characters.
1095 The remote side is requested to send all the current special
1096 character settings, and if there are any discrepancies with
1097 the local side, the local side will switch to the remote value.
1099 Switch to the local defaults for the special characters.
1101 local default characters are those of the local terminal at
1106 Switch to the remote defaults for the special characters.
1107 The remote default characters are those of the remote system
1108 at the time when the
1110 connection was established.
1112 Prints out help information for the
1117 Show the current status of
1119 This includes the peer one is connected to, as well
1120 as the current mode.
1121 .It Ic toggle Ar arguments ...
1126 various flags that control how
1129 These flags may be set explicitly to
1137 commands listed above.
1138 More than one argument may be specified.
1139 The state of these flags may be interrogated with the
1142 Valid arguments are:
1145 Turns on debugging information for the authentication code.
1157 characters are recognized (and transformed into
1163 refuses to display any data on the user's terminal
1164 until the remote system acknowledges (via a
1165 .Dv TELNET TIMING MARK
1167 that it has processed those
1170 The initial value for this toggle is
1172 if the terminal user had not
1173 done an "stty noflsh", otherwise
1180 option is negotiated, by
1181 default the actual encryption (decryption) of the data
1182 stream does not start automatically.
1184 (autodecrypt) command states that encryption of the
1185 output (input) stream should be enabled as soon as
1188 Note: Because of export controls, the
1190 option is not supported outside the United States and Canada.
1192 If the remote side supports the
1193 .Dv TELNET AUTHENTICATION
1196 attempts to use it to perform automatic authentication.
1199 option is not supported, the user's login
1200 name are propagated through the
1203 This command is the same as specifying the
1215 then when either the
1219 characters is typed (see
1221 above for descriptions of the
1225 characters), the resulting
1227 sequence sent is followed by the
1232 cause the remote system to begin throwing away all previously
1233 typed input until both of the
1235 sequences have been read and acted upon.
1236 The initial value of this toggle is
1239 Enable or disable the
1241 option on both input and output.
1243 Enable or disable the
1247 Enable or disable the
1253 then carriage returns will be sent as
1254 .Li \*[Lt]CR\*[Gt]\*[Lt]LF\*[Gt] .
1257 then carriage returns will be send as
1258 .Li \*[Lt]CR\*[Gt]\*[Lt]NUL\*[Gt] .
1259 The initial value for this toggle is
1262 Toggle carriage return mode.
1263 When this mode is enabled, most carriage return characters received from
1264 the remote host will be mapped into a carriage return followed by
1266 This mode does not affect those characters typed by the user, only
1267 those received from the remote host.
1268 This mode is not very useful unless the remote host
1269 only sends carriage return, but never line feed.
1270 The initial value for this toggle is
1273 Toggles socket level debugging (useful only to the
1275 The initial value for this toggle is
1278 Turns on debugging information for the encryption code.
1291 above) are recognized locally, and transformed into (hopefully) appropriate
1304 The initial value for this toggle is
1306 in \*(Lqold line by line\*(Rq mode,
1309 in \*(Lqcharacter at a time\*(Rq mode.
1312 option is enabled, the value of
1314 is ignored, and assumed to always be
1318 has ever been enabled, then
1332 Toggles the display of all network data (in hexadecimal format).
1333 The initial value for this toggle is
1336 Toggles the display of some internal
1338 protocol processing (having to do with
1341 The initial value for this toggle is
1346 toggle is enabled, if
1348 is enabled the output from the
1350 command will be formatted in a more user readable format.
1351 Spaces are put between each character in the output, and the
1354 escape sequence is preceded by a '*' to aid in locating them.
1356 When the skiprc toggle is
1359 skips the reading of the
1361 file in the users home
1362 directory when connections are opened.
1364 value for this toggle is
1367 Toggles the display of all terminal data (in hexadecimal format).
1368 The initial value for this toggle is
1370 .It Ic verbose_encrypt
1376 prints out a message each time encryption is enabled or
1378 The initial value for this toggle is
1380 Note: Because of export controls, data encryption
1381 is not supported outside of the United States and Canada.
1390 This command only works when the user is using the
1392 .It Ic \&! Op Ar command
1393 Execute a single command in a subshell on the local
1397 is omitted, then an interactive
1398 subshell is invoked.
1399 .It Ic \&? Op Ar command
1403 prints a help summary.
1404 If a command is specified,
1406 will print the help information for just that command.
1416 environment variables.
1417 Other environment variables may be propagated
1418 to the other side via the
1422 .Bl -tag -width ~/.telnetrc -compact
1424 user customized telnet startup values
1431 IPsec support was added by WIDE/KAME project, in 1999.
1433 On some remote systems, echo has to be turned off manually when in
1434 \*(Lqold line by line\*(Rq mode.
1436 In \*(Lqold line by line\*(Rq mode or
1440 character is only recognized (and sent to the remote system)
1441 when it is the first character on a line.