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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)telnet.1 8.6 (Berkeley) 6/1/94
31 .Dd September 29, 2022
36 .Nd user interface to the
41 .Op Fl 468EFKLNQacdfruxy
45 .Op Fl e Ar escapechar
59 is used to communicate with another host using the
64 is invoked without the
66 argument, it enters command mode,
67 indicated by its prompt
69 In this mode, it accepts and executes the commands listed below.
70 If it is invoked with arguments, it performs an
72 command with those arguments.
75 .Bl -tag -width indent
79 to use IPv4 addresses only.
83 to use IPv6 addresses only.
85 Specifies an 8-bit data path.
86 This causes an attempt to
89 option on both input and output.
94 Stops any character from being recognized as an escape character.
96 If Kerberos V5 authentication is being used, the
98 option allows the local credentials to be forwarded
99 to the remote system, including any credentials that
100 have already been forwarded into the local environment.
102 Specifies no automatic login to the remote system.
104 Specifies an 8-bit data path on output.
107 option to be negotiated on output.
109 Prevents IP address to name lookup when destination host is given
113 This suppresses the messages
115 would normally output upon connecting or disconnecting.
117 Sets the IP type-of-service (TOS) option for the telnet
118 connection to the value
120 which can be a numeric TOS value
121 or, on systems that support it, a symbolic
122 TOS name found in the
128 type of authentication.
130 Attempt automatic login.
131 This is now the default, so this option is ignored.
132 Currently, this sends the user name via the
137 option if supported by the remote system.
138 The name used is that of the current user as returned by
140 if it agrees with the current user ID,
141 otherwise it is the name associated with the user ID.
143 Disables the reading of the user's
148 command on this man page.)
150 Sets the initial value of the
154 .It Fl e Ar escapechar
162 there will be no escape character.
164 If Kerberos V5 authentication is being used, the
166 option allows the local credentials to be forwarded to the remote system.
168 If Kerberos authentication is being used, the
172 obtain tickets for the remote host in
175 instead of the remote host's realm, as determined by
176 .Xr krb_realmofhost 3 .
178 When connecting to the remote system, if the remote system
183 will be sent to the remote system as the value for the variable
185 This option implies the
188 This option may also be used with the
191 .It Fl n Ar tracefile
194 for recording trace information.
199 Use IPsec policy specification string
203 .Xr ipsec_set_policy 3
206 Specifies a user interface similar to
209 mode, the escape character is set to the tilde (~) character,
210 unless modified by the
214 Set the source IP address for the
218 which can be an IP address or a host name.
224 addresses only (e.g.,
226 domain sockets, accessed with a file path).
228 Turns on encryption of the data stream if possible.
229 This is now the default, so this option is ignored.
231 Suppresses encryption of the data stream.
233 Indicates the official name, an alias, or the Internet address
240 establishes a connection to the corresponding named socket.
242 Indicates a port number (address of an application).
244 not specified, the default
249 When in rlogin mode, a line of the form ~.\& disconnects from the
250 remote host; ~ is the
253 Similarly, the line ~^Z suspends the
256 The line ~^] escapes to the normal
260 Once a connection has been opened,
262 will attempt to enable the
267 will revert to one of two input modes:
268 either \*(Lqcharacter at a time\*(Rq
269 or \*(Lqold line by line\*(Rq
270 depending on what the remote system supports.
274 is enabled, character processing is done on the
275 local system, under the control of the remote system.
277 editing or character echoing is to be disabled, the remote system
278 will relay that information.
279 The remote system will also relay
280 changes to any special characters that happen on the remote
281 system, so that they can take effect on the local system.
283 In \*(Lqcharacter at a time\*(Rq mode, most
284 text typed is immediately sent to the remote host for processing.
286 In \*(Lqold line by line\*(Rq mode, all text is echoed locally,
287 and (normally) only completed lines are sent to the remote host.
288 The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used
289 to turn off and on the local echo
290 (this would mostly be used to enter passwords
291 without the password being echoed).
295 option is enabled, or if the
299 (the default for \*(Lqold line by line\*(Rq; see below),
305 characters are trapped locally, and sent as
307 protocol sequences to the remote side.
310 has ever been enabled, then the user's
323 There are options (see
330 which cause this action to flush subsequent output to the terminal
331 (until the remote host acknowledges the
333 sequence) and flush previous terminal input
339 While connected to a remote host,
341 command mode may be entered by typing the
343 \*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq).
344 When in command mode, the normal terminal editing conventions are available.
348 commands are available.
349 Only enough of each command to uniquely identify it need be typed
350 (this is also true for arguments to the
360 .Bl -tag -width "mode type"
361 .It Ic auth Ar argument ...
362 The auth command manipulates the information sent through the
363 .Dv TELNET AUTHENTICATE
365 Valid arguments for the
368 .Bl -tag -width "disable type"
369 .It Ic disable Ar type
370 Disables the specified type of authentication.
372 obtain a list of available types, use the
375 .It Ic enable Ar type
376 Enables the specified type of authentication.
378 obtain a list of available types, use the
382 Lists the current status of the various types of
388 session and return to command mode.
389 .It Ic display Ar argument ...
390 Displays all, or some, of the
395 .It Ic encrypt Ar argument ...
396 The encrypt command manipulates the information sent through the
400 Valid arguments for the
404 .It Ic disable Ar type Xo
405 .Op Cm input | output
407 Disables the specified type of encryption.
409 omit the input and output, both input and output
411 To obtain a list of available
413 .Ic encrypt disable ?\&
415 .It Ic enable Ar type Xo
416 .Op Cm input | output
418 Enables the specified type of encryption.
420 omit input and output, both input and output are
422 To obtain a list of available types, use the
423 .Ic encrypt enable ?\&
426 This is the same as the
427 .Ic encrypt start input
430 This is the same as the
431 .Ic encrypt stop input
434 This is the same as the
435 .Ic encrypt start output
438 This is the same as the
439 .Ic encrypt stop output
441 .It Ic start Op Cm input | output
442 Attempts to start encryption.
447 both input and output are enabled.
449 obtain a list of available types, use the
450 .Ic encrypt enable ?\&
453 Lists the current status of encryption.
454 .It Ic stop Op Cm input | output
456 If you omit input and output,
457 encryption is on both input and output.
459 Sets the default type of encryption to be used
466 .It Ic environ Ar arguments ...
469 command is used to manipulate the
470 variables that may be sent through the
473 The initial set of variables is taken from the users
474 environment, with only the
478 variables being exported by default.
481 variable is also exported if the
487 Valid arguments for the
491 .It Ic define Ar variable value
496 Any variables defined by this command are automatically exported.
499 may be enclosed in single or double quotes so
500 that tabs and spaces may be included.
501 .It Ic undefine Ar variable
504 from the list of environment variables.
505 .It Ic export Ar variable
508 to be exported to the remote side.
509 .It Ic unexport Ar variable
512 to not be exported unless
513 explicitly asked for by the remote side.
515 List the current set of environment variables.
518 will be sent automatically,
519 other variables will only be sent if explicitly requested.
521 Prints out help information for the
528 option to the remote side.
529 This command is similar to a
531 command; however, if the remote side does not support the
533 option, nothing happens.
534 If, however, the remote side does support the
536 option, this command should cause the remote side to close the
539 If the remote side also supports the concept of
540 suspending a user's session for later reattachment,
541 the logout argument indicates that you
542 should terminate the session immediately.
545 is one of several options, depending on the state of the
548 The remote host is asked for permission to go into the requested mode.
549 If the remote host is capable of entering that mode, the requested
550 mode will be entered.
555 option, or, if the remote side does not understand the
557 option, then enter \*(Lqcharacter at a time\*(Rq mode.
561 option, or, if the remote side does not understand the
563 option, then attempt to enter \*(Lqold-line-by-line\*(Rq mode.
564 .It Ic isig Pq Ic \-isig
565 Attempt to enable (disable) the
570 This requires that the
573 .It Ic edit Pq Ic \-edit
574 Attempt to enable (disable) the
579 This requires that the
582 .It Ic softtabs Pq Ic \-softtabs
583 Attempt to enable (disable) the
588 This requires that the
591 .It Ic litecho Pq Ic \-litecho
592 Attempt to enable (disable) the
597 This requires that the
601 Prints out help information for the
609 .Op Oo Fl /+ Oc Ns Ar port
611 Open a connection to the named host.
615 will attempt to contact a
617 server at the default port.
618 The host specification may be either a host name (see
620 an Internet address specified in the \*(Lqdot notation\*(Rq (see
622 or IPv6 host name or IPv6 coloned-hexadecimal address.
625 option may be used to specify the user name
626 to be passed to the remote system via the
629 When connecting to a non-standard port,
631 omits any automatic initiation of
634 When the port number is preceded by a minus sign,
635 the initial option negotiation is done.
636 When, however, the port number
637 is preceded by a plus sign,
638 any option negotiation and understanding is prohibited,
639 making telnet dumb client for POP3/SMTP/NNTP/HTTP-like
640 protocols with any data including
642 IAC character (0xff).
643 After establishing a connection, the file
646 users home directory is opened.
647 Lines beginning with a # are
649 Blank lines are ignored.
651 without white space are the start of a machine entry.
653 first thing on the line is the name of the machine that is
655 It may be the hostname or numeric address specified as the argument
657 the canonical name of that string as determined by
661 indicating all hosts.
662 The rest of the line, and successive
663 lines that begin with white space are assumed to be
665 commands and are processed as if they had been typed
674 An end of file (in command mode) will also close a session and exit.
675 .It Ic send Ar arguments
676 Sends one or more special character sequences to the remote host.
677 The following are the arguments which may be specified
678 (more than one argument may be specified at a time):
679 .Bl -tag -width escape
689 (Abort Output) sequence, which should cause the remote system to flush
699 sequence, to which the remote system may or may not choose to respond.
703 (Break) sequence, which may have significance to the remote
709 sequence, which should cause the remote system to erase the last character
715 sequence, which should cause the remote system to erase the line currently
730 escape character (initially \*(Lq^\*(Rq).
735 sequence, which likely has no significance to the remote system.
737 If the remote side supports the
741 will send the subnegotiation to request that the server send
742 its current option status.
746 (Interrupt Process) sequence, which should cause the remote
747 system to abort the currently running process.
762 This sequence causes the remote system to discard all previously typed
763 (but not yet read) input.
764 This sequence is sent as
767 data (and may not work if the remote system is a
770 it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
780 can be either a decimal number between 0 and 255,
781 or a symbolic name for a specific
789 to print out help information, including
790 a list of known symbolic names.
792 Prints out help information for the
796 .It Ic set Ar argument value
797 .It Ic unset Ar argument value
800 command will set any one of a number of
802 variables to a specific value or to
806 turns off the function associated with
807 the variable, this is equivalent to using the
812 command will disable or set to
814 any of the specified functions.
815 The values of variables may be interrogated with the
818 The variables which may be set or unset, but not toggled, are
820 In addition, any of the variables for the
822 command may be explicitly set or unset using
828 .Bl -tag -width escape
832 is in localchars mode, or
834 is enabled, and the status character is typed, a
838 preceding) is sent to the
840 The initial value for the \*(LqAre You There\*(Rq
841 character is the terminal's status character.
843 This is the value (initially \*(Lq^E\*(Rq) which, when in
844 \*(Lqline by line\*(Rq mode, toggles between doing local echoing
845 of entered characters (for normal processing), and suppressing
846 echoing of entered characters (for entering, say, a password).
852 or \*(Lqold line by line\*(Rq mode, entering this character
853 as the first character on a line will cause this character to be
854 sent to the remote system.
855 The initial value of the eof character is taken to be the terminal's
870 is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
871 character is typed, a
877 is sent to the remote system.
878 The initial value for the erase character is taken to be
885 escape character (initially \*(Lq^[\*(Rq) which causes entry
888 command mode (when connected to a remote system).
900 character is typed, a
906 is sent to the remote host.
907 The initial value for the flush character is taken to be
918 characters that, when typed, cause partial lines to be
919 forwarded to the remote system.
920 The initial value for
921 the forwarding characters are taken from the terminal's
922 eol and eol2 characters.
934 character is typed, a
940 is sent to the remote host.
941 The initial value for the interrupt character is taken to be
957 is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
958 character is typed, a
964 is sent to the remote system.
965 The initial value for the kill character is taken to be
974 or \*(Lqold line by line\*(Rq mode, then this character is taken to
978 The initial value for the lnext character is taken to be
993 character is typed, a
999 is sent to the remote host.
1000 The initial value for the quit character is taken to be
1009 or \*(Lqold line by line\*(Rq mode, then this character is taken to
1013 The initial value for the reprint character is taken to be
1018 This is the rlogin escape character.
1021 escape character is ignored unless it is
1022 preceded by this character at the beginning of a line.
1023 This character, at the beginning of a line followed by
1024 a "." closes the connection; when followed by a ^Z it
1028 The initial state is to
1034 .Dv TELNET TOGGLE-FLOW-CONTROL
1035 option has been enabled,
1036 then this character is taken to
1040 The initial value for the start character is taken to be
1046 .Dv TELNET TOGGLE-FLOW-CONTROL
1047 option has been enabled,
1048 then this character is taken to
1052 The initial value for the stop character is taken to be
1065 character is typed, a
1071 is sent to the remote host.
1072 The initial value for the suspend character is taken to be
1077 This is the file to which the output, caused by
1086 then tracing information will be written to standard output (the default).
1092 or \*(Lqold line by line\*(Rq mode, then this character is taken to
1096 The initial value for the worderase character is taken to be
1109 command (Set Local Characters) is used to set
1110 or change the state of the special
1115 Special characters are characters that get
1118 commands sequences (like
1122 or line editing characters (like
1126 By default, the local special characters are exported.
1129 Verify the current settings for the current special characters.
1130 The remote side is requested to send all the current special
1131 character settings, and if there are any discrepancies with
1132 the local side, the local side will switch to the remote value.
1134 Switch to the local defaults for the special characters.
1136 local default characters are those of the local terminal at
1141 Switch to the remote defaults for the special characters.
1142 The remote default characters are those of the remote system
1143 at the time when the
1145 connection was established.
1147 Prints out help information for the
1152 Show the current status of
1154 This includes the peer one is connected to, as well
1155 as the current mode.
1156 .It Ic toggle Ar arguments ...
1161 various flags that control how
1164 These flags may be set explicitly to
1172 commands listed above.
1173 More than one argument may be specified.
1174 The state of these flags may be interrogated with the
1177 Valid arguments are:
1180 Turns on debugging information for the authentication code.
1192 characters are recognized (and transformed into
1198 refuses to display any data on the user's terminal
1199 until the remote system acknowledges (via a
1200 .Dv TELNET TIMING MARK
1202 that it has processed those
1205 The initial value for this toggle is
1207 if the terminal user had not
1208 done an "stty noflsh", otherwise
1215 option is negotiated, by
1216 default the actual encryption (decryption) of the data
1217 stream does not start automatically.
1219 (autodecrypt) command states that encryption of the
1220 output (input) stream should be enabled as soon as
1223 If the remote side supports the
1224 .Dv TELNET AUTHENTICATION
1227 attempts to use it to perform automatic authentication.
1230 option is not supported, the user's login
1231 name are propagated through the
1234 This command is the same as specifying
1246 then when either the
1250 characters is typed (see
1252 above for descriptions of the
1256 characters), the resulting
1258 sequence sent is followed by the
1263 cause the remote system to begin throwing away all previously
1264 typed input until both of the
1266 sequences have been read and acted upon.
1267 The initial value of this toggle is
1270 Enable or disable the
1272 option on both input and output.
1274 Enable or disable the
1278 Enable or disable the
1284 then carriage returns will be sent as
1288 then carriage returns will be send as
1290 The initial value for this toggle is
1293 Toggle carriage return mode.
1294 When this mode is enabled, most carriage return characters received from
1295 the remote host will be mapped into a carriage return followed by
1297 This mode does not affect those characters typed by the user, only
1298 those received from the remote host.
1299 This mode is not very useful unless the remote host
1300 only sends carriage return, but never line feed.
1301 The initial value for this toggle is
1304 Toggles socket level debugging (useful only to the
1306 The initial value for this toggle is
1309 Turns on debugging information for the encryption code.
1322 above) are recognized locally, and transformed into (hopefully) appropriate
1335 The initial value for this toggle is
1337 in \*(Lqold line by line\*(Rq mode,
1340 in \*(Lqcharacter at a time\*(Rq mode.
1343 option is enabled, the value of
1345 is ignored, and assumed to always be
1349 has ever been enabled, then
1365 Toggles the display of all network data (in hexadecimal format).
1366 The initial value for this toggle is
1369 Toggles the display of some internal
1371 protocol processing (having to do with
1374 The initial value for this toggle is
1379 toggle is enabled, if
1381 is enabled the output from the
1383 command will be formatted in a more user readable format.
1384 Spaces are put between each character in the output, and the
1387 escape sequence is preceded by a '*' to aid in locating them.
1389 When the skiprc toggle is
1392 skips the reading of the
1394 file in the users home
1395 directory when connections are opened.
1397 value for this toggle is
1400 Toggles the display of all terminal data (in hexadecimal format).
1401 The initial value for this toggle is
1403 .It Ic verbose_encrypt
1409 prints out a message each time encryption is enabled or
1411 The initial value for this toggle is
1421 This command only works when the user is using the
1423 .It Ic \&! Op Ar command
1424 Execute a single command in a subshell on the local
1428 is omitted, then an interactive
1429 subshell is invoked.
1430 .It Ic ?\& Op Ar command
1434 prints a help summary.
1439 will print the help information for just that command.
1449 environment variables.
1450 Other environment variables may be propagated
1451 to the other side via the
1455 .Bl -tag -width ~/.telnetrc -compact
1457 user customized telnet startup values
1464 .Xr telnetd 8 Pq Pa ports/net/freebsd-telnetd
1471 IPv6 support was added by WIDE/KAME project.
1473 On some remote systems, echo has to be turned off manually when in
1474 \*(Lqold line by line\*(Rq mode.
1476 In \*(Lqold line by line\*(Rq mode or
1480 character is only recognized (and sent to the remote system)
1481 when it is the first character on a line.