TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) ------------------------------------------------------------------------------- telnet, tn, tn3270 PURPOSE Provides the TELNET interface for logging in to a foreign host. SYNTAX +------+ +---------------------+ +--------------------+ telnet, tn ---| |--| |--| |-... +- -d -+ +- -n net_trace_file -+ +- -e terminal_type -+ +-------------------+ ...-| +--------+ |--| +- host -| |-+ +- port -+ DESCRIPTION The telnet command implements the TELNET protocol, which allows remote login to other hosts. It uses the Transmission Control Protocol (TCP) m m u nicate with other hosts in the network. The tn command is identical to the telnet command, and in the following discussion, telnet means either the telnet command or the tn command. The tn3270 command is used to connect to an IBM main frame system and is equivalent to running telnet -e3270. The telnet command operates in two different modes: command mode and input mode. When issued without arguments, telnet enters command mode, as indicated by the "telnet>" prompt. In this mode, the subcommands listed under "Parameters" can be executed. If the telnet command is issued with arguments, it performs a n open subcommand with those arguments, then enters input mode. The type of input mode is either character-at-a-time or line-by-line, depending on what the remote system supports. In character-at-a-time mode, most text typed is immediately sent to the remote host for processing. In line-by-line mode, all text is echoed locally and completed lines are sent to the remote host. The local echo character is used to shut the local echo off and turn it back on. Its initial value is Ctrl-E. In either input mode, if toggle localchars is true (see "Parameters"), the user's QUIT, INTR : , and FLUSH characters are trapped locally and sent as Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 1 TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) TELNET sequences to the remote host. The toggle autoflush and toggle autosynch subcommands cause this action to flush subsequent output to the terminal until the remote host acknowledges the TELNET sequence and to flush previous terminal input (in the case of QUIT and INTR). To enter telnet command mode while connected to a remote host , type the TELNET escape key sequence. The default escape sequence is Ctrl-T. Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 2 TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) You may use screen-oriented programs on a host with which you are communicating through telnet. The telnet comman d will pass the name of your local terminal type through to the remote host when you first connect to it. If the remote host supports terminal-negotiation and does not recognize the name of you r terminal, telnet will attempt to negotiate a mutually acceptable terminal type with the remote host. If you are using an HFT terminal (such as the PS/2 console), telnet can emulate either a DEC VT100 terminal or an IBM 3270 terminal. If your local terminal is not an HFT, telnet usually can emulate an IBM 3270 terminal. If you can use the vi command (see the AIX System/370 Text Formatting Guide and the A Operating System Commands Reference for information on the vi command) on your terminal, then telnet can emulate a 3270 using your terminal. If none of the terminals telnet can emulate are acceptable to the remote host, the original terminal type will be used. You may specify a terminal-type to be emulated. If you do so, telnet will not negotiate for terminal type with the remote host. You can bypass terminal emulation and negotiation altogether by asking telnet to emulate terminal "none." To override the terminal negotiation from the console, use the EMULATE environment variable or the -e option. To determine whether terminal-type negotiation is performed, the following list describes the order of the telnet command processing: o The -e command line flag. (No negotiation) o The EMULATE environment variable. (No negotiation) o If the first two items are not present, terminal-type negotiation occurs automatically. If the client and the server negotiate to use a 3270 data stream, the keyboard mapping to be used is determined by the following precedence: $HOME/.3270keys User's 3270 keyboard mapping. /etc/3270.keys Default 3270 keyboard mapping. The telnet command supports these 3270 terminal types: 3277-1 , 3277-2, 3278-2, 3278-3, 3278-4, and 3278-5. If you are using the telnet command in 3270 mode on a color display, the colors and fields are displayed the same as those of an actual 3279 display. RESTRICTIONS The mouse cannot be used as an input device with the telnet command. The telnet command does not support the APL data stream. Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 3 TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) ENVIRONMENT VARIABLES The following environment variables can be used with the telnet k command: EMULATE Specifies type of terminal for telnet to emulate. If giv e the -e flag overrides this variable. The value of EMULATE ma y be set to vt100, but telnet will only try to emulate a vt100 if you are using an HFT terminal. If the type to emulate is 3270, telnet will do so on any terminal (as long as that terminal can be used with vi). TNESC Specifies an alternate TELNET escape character, other than the default Ctrl-T. You can use TNESC to change the telnet escape sequence. To cha n the sequence, set TNESC to the octal value of the character you want to use and export TNESC. Refer to the AIX Operating System Technical Reference for a table that maps octal values to their ASCII equivalents. For more information on using environment variables, see the env command in the AIX Operating System Commands Reference. FLAGS The telnet, tn command options are: -d Turns debugging mode on. -e terminaltype Overrides terminal-type negotiation. Possible values for terminal type are vt100, 3270 and none. -n net_trace_file Records network trace information in the file specified by net_trace_file. PARAMETERS For each of the subcommands listed below, you only need to type enough letters to uniquely identify the command. (For example, q is sufficient for the quit command.) This is also true for the arguments to emulate, display, mode, set, and toggle. The subcommands for telnet and tn are: ? [command] Requests help on telnet. Without arguments, the telnet command prints a help summary. If a command is specified, the telnet command prints help information for just that command. Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 4 TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) close Closes the TELNET connection. If telnet was started with a hostname on the command line, close exits telnet. Otherwise, close returns to command mode. display [argument] Displays all of the set and toggle values if no argument is specified. Otherwise, lists only those values that matches the argument. emulate terminaltype Overrides terminal type negotiation with the specified terminaltype. Possible choices are: ? - Prints help information. 3270 - Emulates a 3270 terminal. none - Specifies no emulation. vt100 - Emulates a DEC VT100 terminal (only on hft). All output received from the remote host is processed by the specified emulator. The initial terminal type to emulate can be specified through the EMULATE environment variable or the -e option to the telnet command. mode type Specifies the current input mode. When type is line, the mode is line by line. When type is character, the mode is character at a time. Permission is requested from the remote host before entering the requested mode, and if the remote host supports it, the new mode is entered. open host [port] Opens a connection to the specified host. The host specification can be either a host name or an Internet address in dotted decimal form. If no port is given, the telnet command attempts to contact a TELNET server at the default port. quit Closes a TELNET connection and exits telnet. An END-OF-FILE in command mode also closes the connection and exits. send arguments Sends one or more arguments (special character sequences) to the remote host. Multiple arguments are separated by spaces. The following arguments can be used: ? - Prints help information for the send command. Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 5 TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) ao - Sends the TELNET AO (Abort Output) sequence, which causes the remote host to flush all output from the remote system to the local terminal. ayt - Sends the TELNET AYT (Are You There) sequence, to which the remote system can respond. brk - Sends the TELNET BRK (Break) sequence. ec - Sends the TELNET EC (Erase Character) sequence, which causes the remote host to erase the last character entered. el - Sends the TELNET EL (Erase Line) sequence, which causes the remote system to erase the line currently being entered. escape - Sends the current telnet escape character (Ctrl-T by default). ga - Sends the TELNET GA (Go Ahead) sequence. ip - Sends the TELNET IP (Interrupt Process) sequence, which causes the remote system to cancel the currently running process. nop - Sends the TELNET NOP (No Operation) sequence. synch - Sends the TELNET SYNC sequence. set variable value Sets a TELNET variable to the specified value. The special value off cancels the function associated with the variable name entered. The display command can be used to query the current setting of each variable. The variables that can be specified are: echo - Toggles between local echo of entered characters and suppressing local echo. Local echo is used for normal processing, while suppressing the echo is used for entering text that should not appear on the display, such as passwords. This variable can only be used in line-by-line mode. EOF - Defines the END-OF-FILE character for telnet. When telnet is in line-by-line mode, entering the EOF character as the first character on a line sends the character to the remote host. The initial value for the EOF character is the terminal's EOF character. erase - Defines the erase character for telnet. When telnet is in character-at-a-time mode and localchars is true, typing the erase character sends the TELNET EC sequence to the remote host. The initial value for the erase character is the terminal's erase character. Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 6 TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) escape - Specifies the telnet escape character, which puts telnet into command mode when connected to a remote host. This character can also be specified in octal in the TNESC environment variable. flushoutput - Defines the flush character for telnet. When localchars is true, typing the flushoutput character sends the TELNET AO sequence to the remote host. The initial value for the flush character is Ctrl-O. If the remote host is running AIX, flushoutput, unlike the other special characters defined by set, only works in localchars mode since it has no termio equivalent. interrupt - Defines the interrupt character for telnet. When localchars is true, typing the interrupt character sends the TELNET IP sequence to the remote host. The initial value for the interrupt character is the terminal's interrupt character. kill - Defines the kill character for telnet. When telnet is in character-at-a-time mode and localchars is true, typing the kill character sends the TELNET EL sequence to the remote host. The initial value for the kill character is the terminal's kill character. quit - Defines the quit character for telnet. When localchars is true, typing the quit character sends the TELNET BRK sequence to the remote host. The initial value for the quit character is the terminal's quit character. status Shows the status of telnet, including the current mode and the currently connected remote host. toggle arguments Toggles one or more arguments that control how telnet responds to events. Possible values are true and false. Multiple arguments are separated by spaces. The display command can be used to query the current setting of each argument. The following arguments can be used: ? - Displays valid arguments to toggle. autoflush - If autoflush and localchars are both true, then when the AO, INTR, and QUIT characters are recognized and transformed into TELNET sequences, telnet does not display any data on the user's terminal until the remote system acknowledges (with a TELNET timing mark option) that it has processed those TELNET sequences. The initial value of autoflush is true if the terminal has not done an stty noflsh and false if it has. Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 7 TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) autosynch - If autosynch and localchars are both true, then typing the INTR or QUIT character sends that character's TELNET sequence, followed by the TELNET SYNC sequence. This procedure causes the remote host to discard all previously typed input until both of the TELNET sequences have been read and acted upon. The initial value of this toggle is false. crmod - Toggles carriage return mode. When set to true, most carriage return characters received from the remote host are mapped into a carriage return followed by a line feed. This mode does not affect the characters typed by the user, only those received from the remote host. This mode is useful when the remote host sends only a carriage return and not a line feed. The initial value of this toggle is false. debug - Toggles debugging at the socket level. This argument can only be entered by a user with superuser privileges. The initial value of this toggle is false. localchars - Determines the handling of TELNET special characters. When this value is true, the ERASE, FLUSH, INTERRUPT, KILL, and QUIT characters are recognized locally and transformed into the appropriate TELNET control sequences (EC, AO, IP, BRK, and EL, respectively). The initial value of localchars is true in line-by-line mode and false in character-at-a-time mode. netdata - Toggles the display of all network data (in hexadecimal format). The data is written to standard output unless a net_trace_file is specified with the -n flag on the telnet command line. The initial value of this toggle is false. options - Toggles the display of some internal TELNET processing options. The initial value of this toggle is false. z - Suspends this TELNET session. If the user's shell does not support job control (assumed to be true if no stty susp character has been set), then this command will open a sub-shell on the local host. The shell started is the one specified by the SHELL environment variable. When the shell is exited, telnet returns to its previous mode. EXAMPLES 1. To log in to host1 and do terminal type negotiation: Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 8 TELNET, TN, TN3270(1c,C) AIX TCP/IP User s Guide TELNET, TN, TN3270(1c,C) $ tn host1 Trying... Connected to host1. Escape character is '^T'. AIX telnet (host1) login: _ 2. To log in to host1 as a vt100 (no terminal type negotiation): $ EMULATE=vt100; export EMULATE $ tn host1 Trying... Connected to host1. Escape character is '^T'. AIX telnet (host1) login: _ $ tn -e vt100 host1 Trying... Connected to host1. Escape character is '^T'. AIX telnet (host1) login: _ FILES $HOME/.3270keys Defines user's 3270 keyboard mapping. /etc/3270.keys Default 3270 keyboard mapping. RELATED INFORMATION In this book: "telnetd." pty device driver, refer to AIX Operating System Technical Reference. Processed March 8, 1991 TELNET, TN, TN3270(1c,C) 9