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 November 11, 2019 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 slc Ar state 1060The 1061.Ic slc 1062command (Set Local Characters) is used to set 1063or change the state of the special 1064characters when the 1065.Dv TELNET LINEMODE 1066option has been enabled. 1067Special characters are characters that get mapped to 1068.Tn TELNET 1069commands sequences (like 1070.Ic ip 1071or 1072.Ic quit ) 1073or line editing characters (like 1074.Ic erase 1075and 1076.Ic kill ) . 1077By default, the local special characters are exported. 1078.Bl -tag -width Fl 1079.It Ic check 1080Verify the current settings for the current special characters. 1081The remote side is requested to send all the current special 1082character settings, and if there are any discrepancies with 1083the local side, the local side will switch to the remote value. 1084.It Ic export 1085Switch to the local defaults for the special characters. 1086The local default characters are those of the local terminal at the time when 1087.Nm 1088was started. 1089.It Ic import 1090Switch to the remote defaults for the special characters. 1091The remote default characters are those of the remote system 1092at the time when the 1093.Tn TELNET 1094connection was established. 1095.It Ic ?\& 1096Prints out help information for the 1097.Ic slc 1098command. 1099.El 1100.It Ic status 1101Show the current status of 1102.Nm . 1103This includes the peer one is connected to, as well 1104as the current mode. 1105.It Ic toggle Ar arguments ... 1106Toggle (between 1107.Dv TRUE 1108and 1109.Dv FALSE ) 1110various flags that control how 1111.Nm 1112responds to events. 1113These flags may be set explicitly to 1114.Dv TRUE 1115or 1116.Dv FALSE 1117using the 1118.Ic set 1119and 1120.Ic unset 1121commands listed above. 1122More than one argument may be specified. 1123The state of these flags may be interrogated with the 1124.Ic display 1125command. 1126Valid arguments are: 1127.Bl -tag -width Ar 1128.It Ic authdebug 1129Turns on debugging information for the authentication code. 1130.It Ic autoflush 1131If 1132.Ic autoflush 1133and 1134.Ic localchars 1135are both 1136.Dv TRUE , 1137then when the 1138.Ic ao , 1139or 1140.Ic quit 1141characters are recognized (and transformed into 1142.Tn TELNET 1143sequences; see 1144.Ic set 1145above for details), 1146.Nm 1147refuses to display any data on the user's terminal 1148until the remote system acknowledges (via a 1149.Dv TELNET TIMING MARK 1150option) 1151that it has processed those 1152.Tn TELNET 1153sequences. 1154The initial value for this toggle is 1155.Dv TRUE 1156if the terminal user had not 1157done an "stty noflsh", otherwise 1158.Dv FALSE 1159(see 1160.Xr stty 1 ) . 1161.It Ic autodecrypt 1162When the 1163.Dv TELNET ENCRYPT 1164option is negotiated, by 1165default the actual encryption (decryption) of the data 1166stream does not start automatically. 1167The autoencrypt (autodecrypt) command states that encryption of the 1168output (input) stream should be enabled as soon as possible. 1169.It Ic autologin 1170If the remote side supports the 1171.Dv TELNET AUTHENTICATION 1172option 1173.Nm 1174attempts to use it to perform automatic authentication. 1175If the 1176.Dv AUTHENTICATION 1177option is not supported, the user's login 1178name are propagated through the 1179.Dv TELNET ENVIRON 1180option. 1181This command is the same as specifying 1182.Fl a 1183option on the 1184.Ic open 1185command. 1186.It Ic autosynch 1187If 1188.Ic autosynch 1189and 1190.Ic localchars 1191are both 1192.Dv TRUE , 1193then when either the 1194.Ic intr 1195or 1196.Ic quit 1197characters is typed (see 1198.Ic set 1199above for descriptions of the 1200.Ic intr 1201and 1202.Ic quit 1203characters), the resulting 1204.Tn TELNET 1205sequence sent is followed by the 1206.Dv TELNET SYNCH 1207sequence. 1208This procedure 1209.Ic should 1210cause the remote system to begin throwing away all previously 1211typed input until both of the 1212.Tn TELNET 1213sequences have been read and acted upon. 1214The initial value of this toggle is 1215.Dv FALSE . 1216.It Ic binary 1217Enable or disable the 1218.Dv TELNET BINARY 1219option on both input and output. 1220.It Ic inbinary 1221Enable or disable the 1222.Dv TELNET BINARY 1223option on input. 1224.It Ic outbinary 1225Enable or disable the 1226.Dv TELNET BINARY 1227option on output. 1228.It Ic crlf 1229If this is 1230.Dv TRUE , 1231then carriage returns will be sent as 1232.Li <CR><LF> . 1233If this is 1234.Dv FALSE , 1235then carriage returns will be sent as 1236.Li <CR><NUL> . 1237The initial value for this toggle is 1238.Dv FALSE . 1239.It Ic crmod 1240Toggle carriage return mode. 1241When this mode is enabled, most carriage return characters received from 1242the remote host will be mapped into a carriage return followed by 1243a line feed. 1244This mode does not affect those characters typed by the user, only 1245those received from the remote host. 1246This mode is not very useful unless the remote host 1247only sends carriage return, but never line feed. 1248The initial value for this toggle is 1249.Dv FALSE . 1250.It Ic debug 1251Toggles socket level debugging (useful only to the 1252.Ic super user ) . 1253The initial value for this toggle is 1254.Dv FALSE . 1255.It Ic encdebug 1256Turns on debugging information for the encryption code. 1257.It Ic localchars 1258If this is 1259.Dv TRUE , 1260then the 1261.Ic flush , 1262.Ic interrupt , 1263.Ic quit , 1264.Ic erase , 1265and 1266.Ic kill 1267characters (see 1268.Ic set 1269above) are recognized locally, and transformed into (hopefully) appropriate 1270.Tn TELNET 1271control sequences 1272(respectively 1273.Ic ao , 1274.Ic ip , 1275.Ic brk , 1276.Ic ec , 1277and 1278.Ic el ; 1279see 1280.Ic send 1281above). 1282The initial value for this toggle is 1283.Dv TRUE 1284in \*(Lqold line by line\*(Rq mode, 1285and 1286.Dv FALSE 1287in \*(Lqcharacter at a time\*(Rq mode. 1288When the 1289.Dv LINEMODE 1290option is enabled, the value of 1291.Ic localchars 1292is ignored, and assumed to always be 1293.Dv TRUE . 1294If 1295.Dv LINEMODE 1296has ever been enabled, then 1297.Ic quit 1298is sent as 1299.Ic abort , 1300and 1301.Ic eof 1302and 1303.Ic suspend 1304are sent as 1305.Ic eof 1306and 1307.Ic susp 1308(see 1309.Ic send 1310above). 1311.It Ic netdata 1312Toggles the display of all network data (in hexadecimal format). 1313The initial value for this toggle is 1314.Dv FALSE . 1315.It Ic options 1316Toggles the display of some internal 1317.Nm 1318protocol processing (having to do with 1319.Tn TELNET 1320options). 1321The initial value for this toggle is 1322.Dv FALSE . 1323.It Ic prettydump 1324When the 1325.Ic netdata 1326toggle is enabled, if 1327.Ic prettydump 1328is enabled the output from the 1329.Ic netdata 1330command will be formatted in a more user readable format. 1331Spaces are put between each character in the output, and the 1332beginning of any 1333.Nm 1334escape sequence is preceded by a '*' to aid in locating them. 1335.It Ic skiprc 1336When the skiprc toggle is 1337.Dv TRUE , 1338.Nm 1339skips the reading of the 1340.Pa \&.telnetrc 1341file in the users home 1342directory when connections are opened. 1343The initial value for this toggle is 1344.Dv FALSE . 1345.It Ic termdata 1346Toggles the display of all terminal data (in hexadecimal format). 1347The initial value for this toggle is 1348.Dv FALSE . 1349.It Ic verbose_encrypt 1350When the 1351.Ic verbose_encrypt 1352toggle is 1353.Dv TRUE , 1354.Nm 1355prints out a message each time encryption is enabled or disabled. 1356The initial value for this toggle is 1357.Dv FALSE . 1358.It Ic ?\& 1359Displays the legal 1360.Ic toggle 1361commands. 1362.El 1363.It Ic z 1364Suspend 1365.Nm . 1366This command only works when the user is using the 1367.Xr csh 1 . 1368.It Ic \&! Op Ar command 1369Execute a single command in a subshell on the local system. 1370If 1371.Ar command 1372is omitted, then an interactive 1373subshell is invoked. 1374.It Ic ?\& Op Ar command 1375Get help. 1376With no arguments, 1377.Nm 1378prints a help summary. 1379If 1380.Ar command 1381is specified, 1382.Nm 1383will print the help information for just that command. 1384.El 1385.Sh ENVIRONMENT 1386The 1387.Nm 1388utility uses at least the 1389.Ev HOME , 1390.Ev SHELL , 1391.Ev DISPLAY , 1392and 1393.Ev TERM 1394environment variables. 1395Other environment variables may be propagated 1396to the other side via the 1397.Dv TELNET ENVIRON 1398option. 1399.Sh FILES 1400.Bl -tag -width ~/.telnetrc -compact 1401.It Pa ~/.telnetrc 1402user customized telnet startup values 1403.El 1404.Sh SEE ALSO 1405.Xr rlogin 1 Pq Pa net/bsdrcmds , 1406.Xr rsh 1 Pq Pa net/bsdrcmds , 1407.Xr hosts 5 , 1408.Xr nologin 5 , 1409.Xr telnetd 8 1410.Sh HISTORY 1411The 1412.Nm 1413command appeared in 1414.Bx 4.2 . 1415.Pp 1416IPv6 support was added by WIDE/KAME project. 1417.Sh NOTES 1418On some remote systems, echo has to be turned off manually when in 1419\*(Lqold line by line\*(Rq mode. 1420.Pp 1421In \*(Lqold line by line\*(Rq mode or 1422.Dv LINEMODE 1423the terminal's 1424.Ic eof 1425character is only recognized (and sent to the remote system) 1426when it is the first character on a line. 1427