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