1 .\" Copyright (c) 1983, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)telnet.1 8.5 (Berkeley) 3/1/94
33 .\" $FreeBSD: src/usr.bin/telnet/telnet.1,v 1.15.2.12 2002/12/29 16:35:40 schweikh Exp $
40 .Nd user interface to the
45 .Op Fl 468EFKLNacdfrux
48 .Op Fl e Ar escapechar
61 is used to communicate with another host using the
66 is invoked without the
68 argument, it enters command mode,
69 indicated by its prompt
71 In this mode, it accepts and executes the commands listed below.
72 If it is invoked with arguments, it performs an
74 command with those arguments.
77 .Bl -tag -width indent
81 to use IPv4 addresses only.
85 to use IPv6 addresses only.
87 Specifies an 8-bit data path. This causes an attempt to
90 option on both input and output.
92 Stops any character from being recognized as an escape character.
94 If Kerberos V5 authentication is being used, the
96 option allows the local credentials to be forwarded
97 to the remote system, including any credentials that
98 have already been forwarded into the local environment.
100 Specifies no automatic login to the remote system.
102 Specifies an 8-bit data path on output. This causes the
104 option to be negotiated on output.
106 Prevents IP address to name lookup when destination host is given
109 Sets the IP type-of-service (TOS) option for the telnet
110 connection to the value
112 which can be a numeric TOS value
113 or, on systems that support it, a symbolic
114 TOS name found in the
120 type of authentication.
122 Attempt automatic login.
123 Currently, this sends the user name via the
128 option if supported by the remote system.
129 The name used is that of the current user as returned by
131 if it agrees with the current user ID,
132 otherwise it is the name associated with the user ID.
134 Disables the reading of the user's
138 command on this man page.)
140 Sets the initial value of the
144 .It Fl e Ar escapechar
152 there will be no escape character.
154 If Kerberos V5 authentication is being used, the
156 option allows the local credentials to be forwarded to the remote system.
158 If Kerberos authentication is being used, the
162 obtain tickets for the remote host in
165 instead of the remote host's realm, as determined by
166 .Xr krb_realmofhost 3 .
168 When connecting to the remote system, if the remote system
173 will be sent to the remote system as the value for the variable
175 This option implies the
178 This option may also be used with the
181 .It Fl n Ar tracefile
184 for recording trace information.
189 Specifies a user interface similar to
192 mode, the escape character is set to the tilde (~) character,
193 unless modified by the
197 Set the source IP address for the
201 which can be an IP address or a host name.
207 addresses only (e.g.,
209 domain sockets, accessed with a file path).
211 Turns on encryption of the data stream if possible.
213 Indicates the official name, an alias, or the Internet address
220 establishes a connection to the corresponding named socket.
222 Indicates a port number (address of an application). If a number is
223 not specified, the default
228 When in rlogin mode, a line of the form ~. disconnects from the
229 remote host; ~ is the
232 Similarly, the line ~^Z suspends the
235 The line ~^] escapes to the normal
239 Once a connection has been opened,
241 will attempt to enable the
246 will revert to one of two input modes:
247 either \*(Lqcharacter at a time\*(Rq
248 or \*(Lqold line by line\*(Rq
249 depending on what the remote system supports.
253 is enabled, character processing is done on the
254 local system, under the control of the remote system. When input
255 editing or character echoing is to be disabled, the remote system
256 will relay that information. The remote system will also relay
257 changes to any special characters that happen on the remote
258 system, so that they can take effect on the local system.
260 In \*(Lqcharacter at a time\*(Rq mode, most
261 text typed is immediately sent to the remote host for processing.
263 In \*(Lqold line by line\*(Rq mode, all text is echoed locally,
264 and (normally) only completed lines are sent to the remote host.
265 The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used
266 to turn off and on the local echo
267 (this would mostly be used to enter passwords
268 without the password being echoed).
272 option is enabled, or if the
276 (the default for \*(Lqold line by line\*(Rq; see below),
282 characters are trapped locally, and sent as
284 protocol sequences to the remote side.
287 has ever been enabled, then the user's
300 There are options (see
307 which cause this action to flush subsequent output to the terminal
308 (until the remote host acknowledges the
310 sequence) and flush previous terminal input
316 While connected to a remote host,
318 command mode may be entered by typing the
320 \*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq).
321 When in command mode, the normal terminal editing conventions are available.
325 commands are available.
326 Only enough of each command to uniquely identify it need be typed
327 (this is also true for arguments to the
338 .Bl -tag -width "mode type"
339 .It Ic auth Ar argument ...
340 The auth command manipulates the information sent through the
341 .Dv TELNET AUTHENTICATE
342 option. Valid arguments for the
345 .Bl -tag -width "disable type"
346 .It Ic disable Ar type
347 Disables the specified type of authentication. To
348 obtain a list of available types, use the
351 .It Ic enable Ar type
352 Enables the specified type of authentication. To
353 obtain a list of available types, use the
357 Lists the current status of the various types of
363 session and return to command mode.
364 .It Ic display Ar argument ...
365 Displays all, or some, of the
370 .It Ic encrypt Ar argument ...
371 The encrypt command manipulates the information sent through the
375 Valid arguments for the
379 .It Ic disable Ar type Xo
380 .Op Cm input | output
382 Disables the specified type of encryption. If you
383 omit the input and output, both input and output
384 are disabled. To obtain a list of available
386 .Ic encrypt disable ?\&
388 .It Ic enable Ar type Xo
389 .Op Cm input | output
391 Enables the specified type of encryption. If you
392 omit input and output, both input and output are
393 enabled. To obtain a list of available types, use the
394 .Ic encrypt enable ?\&
397 This is the same as the
398 .Ic encrypt start input
401 This is the same as the
402 .Ic encrypt stop input
405 This is the same as the
406 .Ic encrypt start output
409 This is the same as the
410 .Ic encrypt stop output
412 .It Ic start Op Cm input | output
413 Attempts to start encryption. If you omit
417 both input and output are enabled. To
418 obtain a list of available types, use the
419 .Ic encrypt enable ?\&
422 Lists the current status of encryption.
423 .It Ic stop Op Cm input | output
424 Stops encryption. If you omit input and output,
425 encryption is on both input and output.
427 Sets the default type of encryption to be used
434 .It Ic environ Ar arguments ...
437 command is used to manipulate the
438 variables that may be sent through the
441 The initial set of variables is taken from the users
442 environment, with only the
446 variables being exported by default.
449 variable is also exported if the
455 Valid arguments for the
459 .It Ic define Ar variable value
464 Any variables defined by this command are automatically exported.
467 may be enclosed in single or double quotes so
468 that tabs and spaces may be included.
469 .It Ic undefine Ar variable
472 from the list of environment variables.
473 .It Ic export Ar variable
476 to be exported to the remote side.
477 .It Ic unexport Ar variable
480 to not be exported unless
481 explicitly asked for by the remote side.
483 List the current set of environment variables.
486 will be sent automatically,
487 other variables will only be sent if explicitly requested.
489 Prints out help information for the
496 option to the remote side.
497 This command is similar to a
499 command; however, if the remote side does not support the
501 option, nothing happens.
502 If, however, the remote side does support the
504 option, this command should cause the remote side to close the
507 If the remote side also supports the concept of
508 suspending a user's session for later reattachment,
509 the logout argument indicates that you
510 should terminate the session immediately.
513 is one of several options, depending on the state of the
516 The remote host is asked for permission to go into the requested mode.
517 If the remote host is capable of entering that mode, the requested
518 mode will be entered.
523 option, or, if the remote side does not understand the
525 option, then enter \*(Lqcharacter at a time\*(Rq mode.
529 option, or, if the remote side does not understand the
531 option, then attempt to enter \*(Lqold-line-by-line\*(Rq mode.
532 .It Ic isig Pq Ic \-isig
533 Attempt to enable (disable) the
538 This requires that the
541 .It Ic edit Pq Ic \-edit
542 Attempt to enable (disable) the
547 This requires that the
550 .It Ic softtabs Pq Ic \-softtabs
551 Attempt to enable (disable) the
556 This requires that the
559 .It Ic litecho Pq Ic \-litecho
560 Attempt to enable (disable) the
565 This requires that the
569 Prints out help information for the
576 .Op Oo Fl Oc Ns Ar port
578 Open a connection to the named host.
582 will attempt to contact a
584 server at the default port.
585 The host specification may be either a host name (see
587 an Internet address specified in the \*(Lqdot notation\*(Rq (see
589 or IPv6 host name or IPv6 coloned-hexadecimal address.
592 option may be used to specify the user name
593 to be passed to the remote system via the
596 When connecting to a non-standard port,
598 omits any automatic initiation of
600 options. When the port number is preceded by a minus sign,
601 the initial option negotiation is done.
602 After establishing a connection, the file
605 users home directory is opened. Lines beginning with a # are
606 comment lines. Blank lines are ignored. Lines that begin
607 without white space are the start of a machine entry. The
608 first thing on the line is the name of the machine that is
609 being connected to. The rest of the line, and successive
610 lines that begin with white space are assumed to be
612 commands and are processed as if they had been typed
621 An end of file (in command mode) will also close a session and exit.
622 .It Ic send Ar arguments
623 Sends one or more special character sequences to the remote host.
624 The following are the arguments which may be specified
625 (more than one argument may be specified at a time):
627 .Bl -tag -width escape
637 (Abort Output) sequence, which should cause the remote system to flush
647 sequence, to which the remote system may or may not choose to respond.
651 (Break) sequence, which may have significance to the remote
657 sequence, which should cause the remote system to erase the last character
663 sequence, which should cause the remote system to erase the line currently
678 escape character (initially \*(Lq^\*(Rq).
683 sequence, which likely has no significance to the remote system.
685 If the remote side supports the
689 will send the subnegotiation to request that the server send
690 its current option status.
694 (Interrupt Process) sequence, which should cause the remote
695 system to abort the currently running process.
710 This sequence causes the remote system to discard all previously typed
711 (but not yet read) input.
712 This sequence is sent as
715 data (and may not work if the remote system is a
718 it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
728 can be either a decimal number between 0 and 255,
729 or a symbolic name for a specific
737 to print out help information, including
738 a list of known symbolic names.
740 Prints out help information for the
744 .It Ic set Ar argument value
745 .It Ic unset Ar argument value
748 command will set any one of a number of
750 variables to a specific value or to
754 turns off the function associated with
755 the variable, this is equivalent to using the
760 command will disable or set to
762 any of the specified functions.
763 The values of variables may be interrogated with the
766 The variables which may be set or unset, but not toggled, are
767 listed here. In addition, any of the variables for the
769 command may be explicitly set or unset using
775 .Bl -tag -width escape
779 is in localchars mode, or
781 is enabled, and the status character is typed, a
785 preceding) is sent to the
786 remote host. The initial value for the \*(LqAre You There\*(Rq
787 character is the terminal's status character.
789 This is the value (initially \*(Lq^E\*(Rq) which, when in
790 \*(Lqline by line\*(Rq mode, toggles between doing local echoing
791 of entered characters (for normal processing), and suppressing
792 echoing of entered characters (for entering, say, a password).
798 or \*(Lqold line by line\*(Rq mode, entering this character
799 as the first character on a line will cause this character to be
800 sent to the remote system.
801 The initial value of the eof character is taken to be the terminal's
816 is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
817 character is typed, a
823 is sent to the remote system.
824 The initial value for the erase character is taken to be
831 escape character (initially \*(Lq^[\*(Rq) which causes entry
834 command mode (when connected to a remote system).
846 character is typed, a
852 is sent to the remote host.
853 The initial value for the flush character is taken to be
864 characters that, when typed, cause partial lines to be
865 forwarded to the remote system. The initial value for
866 the forwarding characters are taken from the terminal's
867 eol and eol2 characters.
879 character is typed, a
885 is sent to the remote host.
886 The initial value for the interrupt character is taken to be
902 is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
903 character is typed, a
909 is sent to the remote system.
910 The initial value for the kill character is taken to be
919 or \*(Lqold line by line\*(Rq mode, then this character is taken to
923 The initial value for the lnext character is taken to be
938 character is typed, a
944 is sent to the remote host.
945 The initial value for the quit character is taken to be
954 or \*(Lqold line by line\*(Rq mode, then this character is taken to
958 The initial value for the reprint character is taken to be
963 This is the rlogin escape character.
966 escape character is ignored unless it is
967 preceded by this character at the beginning of a line.
968 This character, at the beginning of a line followed by
969 a "." closes the connection; when followed by a ^Z it
972 command. The initial state is to
978 .Dv TELNET TOGGLE-FLOW-CONTROL
979 option has been enabled,
980 then this character is taken to
984 The initial value for the start character is taken to be
990 .Dv TELNET TOGGLE-FLOW-CONTROL
991 option has been enabled,
992 then this character is taken to
996 The initial value for the stop character is taken to be
1009 character is typed, a
1015 is sent to the remote host.
1016 The initial value for the suspend character is taken to be
1021 This is the file to which the output, caused by
1027 will be written. If it is set to
1029 then tracing information will be written to standard output (the default).
1035 or \*(Lqold line by line\*(Rq mode, then this character is taken to
1039 The initial value for the worderase character is taken to be
1049 .It Ic skey Ar sequence challenge
1052 command computes a response to the S/Key challenge.
1056 command (Set Local Characters) is used to set
1057 or change the state of the special
1061 been enabled. Special characters are characters that get
1064 commands sequences (like
1068 or line editing characters (like
1072 By default, the local special characters are exported.
1075 Verify the current settings for the current special characters.
1076 The remote side is requested to send all the current special
1077 character settings, and if there are any discrepancies with
1078 the local side, the local side will switch to the remote value.
1080 Switch to the local defaults for the special characters. The
1081 local default characters are those of the local terminal at
1086 Switch to the remote defaults for the special characters.
1087 The remote default characters are those of the remote system
1088 at the time when the
1090 connection was established.
1092 Prints out help information for the
1097 Show the current status of
1099 This includes the peer one is connected to, as well
1100 as the current mode.
1101 .It Ic toggle Ar arguments ...
1106 various flags that control how
1109 These flags may be set explicitly to
1117 commands listed above.
1118 More than one argument may be specified.
1119 The state of these flags may be interrogated with the
1122 Valid arguments are:
1125 Turns on debugging information for the authentication code.
1137 characters are recognized (and transformed into
1143 refuses to display any data on the user's terminal
1144 until the remote system acknowledges (via a
1145 .Dv TELNET TIMING MARK
1147 that it has processed those
1150 The initial value for this toggle is
1152 if the terminal user had not
1153 done an "stty noflsh", otherwise
1160 option is negotiated, by
1161 default the actual encryption (decryption) of the data
1162 stream does not start automatically. The autoencrypt
1163 (autodecrypt) command states that encryption of the
1164 output (input) stream should be enabled as soon as
1167 If the remote side supports the
1168 .Dv TELNET AUTHENTICATION
1171 attempts to use it to perform automatic authentication. If the
1173 option is not supported, the user's login
1174 name are propagated through the
1177 This command is the same as specifying
1189 then when either the
1193 characters is typed (see
1195 above for descriptions of the
1199 characters), the resulting
1201 sequence sent is followed by the
1206 cause the remote system to begin throwing away all previously
1207 typed input until both of the
1209 sequences have been read and acted upon.
1210 The initial value of this toggle is
1213 Enable or disable the
1215 option on both input and output.
1217 Enable or disable the
1221 Enable or disable the
1227 then carriage returns will be sent as
1231 then carriage returns will be send as
1233 The initial value for this toggle is
1236 Toggle carriage return mode.
1237 When this mode is enabled, most carriage return characters received from
1238 the remote host will be mapped into a carriage return followed by
1240 This mode does not affect those characters typed by the user, only
1241 those received from the remote host.
1242 This mode is not very useful unless the remote host
1243 only sends carriage return, but never line feed.
1244 The initial value for this toggle is
1247 Toggles socket level debugging (useful only to the
1249 The initial value for this toggle is
1252 Turns on debugging information for the encryption code.
1265 above) are recognized locally, and transformed into (hopefully) appropriate
1278 The initial value for this toggle is
1280 in \*(Lqold line by line\*(Rq mode,
1283 in \*(Lqcharacter at a time\*(Rq mode.
1286 option is enabled, the value of
1288 is ignored, and assumed to always be
1292 has ever been enabled, then
1308 Toggles the display of all network data (in hexadecimal format).
1309 The initial value for this toggle is
1312 Toggles the display of some internal
1314 protocol processing (having to do with
1317 The initial value for this toggle is
1322 toggle is enabled, if
1324 is enabled the output from the
1326 command will be formatted in a more user readable format.
1327 Spaces are put between each character in the output, and the
1330 escape sequence is preceded by a '*' to aid in locating them.
1332 When the skiprc toggle is
1335 skips the reading of the
1337 file in the users home
1338 directory when connections are opened. The initial
1339 value for this toggle is
1342 Toggles the display of all terminal data (in hexadecimal format).
1343 The initial value for this toggle is
1345 .It Ic verbose_encrypt
1351 prints out a message each time encryption is enabled or
1352 disabled. The initial value for this toggle is
1362 This command only works when the user is using the
1364 .It Ic \&! Op Ar command
1365 Execute a single command in a subshell on the local
1368 is omitted, then an interactive
1369 subshell is invoked.
1370 .It Ic ?\& Op Ar command
1371 Get help. With no arguments,
1373 prints a help summary.
1378 will print the help information for just that command.
1383 utility uses at least the
1389 environment variables.
1390 Other environment variables may be propagated
1391 to the other side via the
1401 .Bl -tag -width ~/.telnetrc -compact
1403 user customized telnet startup values
1411 IPv6 support was added by WIDE/KAME project.
1413 On some remote systems, echo has to be turned off manually when in
1414 \*(Lqold line by line\*(Rq mode.
1416 In \*(Lqold line by line\*(Rq mode or
1420 character is only recognized (and sent to the remote system)
1421 when it is the first character on a line.