Connects the local host with a remote host, using the Telnet interface.
{ telnet | tn | tn3270 } [ -d ] [ -p ] [ -n TraceFile ] [ -e TerminalType ] [ -f | -F ] [ -k realm ] [ -l user ] [ Host [ Port ] ]
The telnet command, which is also referred to as the tn or tn3270 command, operates in two different modes: command mode and input mode.
System
The user is assigned a default login Sensitivity Label (SL) and Integrity Label (TL), which is SL and TL of the user's process after successful login.
If the user does not want to login using the default login SL, the user can choose to supply a different SL at the login time using the -e option. The SL that is supplied by the user must be dominated by the user's clearance and contained in the system accreditation range. The TL cannot be specified by the user at login time. The default login SL and TL are defined in the /etc/security/user file along with the username and clearance for each user. To use the -e option, the server side's kernel trusted network bit must be turned off.
Command Mode
When the telnet command is issued without arguments, it enters command mode, as indicated by the telnet>, tn>, or the tn3270> prompt. A user can also enter command mode from input mode by pressing Ctrl-] for the telnet command, Ctrl-T for the tn command, or Ctrl-C for the tn3270 command. In command mode, subcommands can be entered to manage the remote system. Some of these subcommands return you to the remote session upon completion. For those subcommands that do not, pressing the Enter key returns you to the remote session.
Note: The default escape sequence for this command is Ctrl-] for the telnet command, Ctrl-T for the tn command, or Ctrl-C for the tn3270 command. This default can be overridden by changing the TNESC environment variable.
To enter telnet command mode while connected to a remote host, type the Telnet escape key sequence. When in command mode, the standard operating system editing conventions, such as backspace, are available.
Input Mode
When the telnet command is issued with arguments, it performs an open subcommand with those arguments and 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 that is 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.
In either input mode, if the toggle localchars subcommand has a value of True, the user's QUIT, INTR, and FLUSH characters are trapped locally and sent as Telnet Protocol 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 characters).
Arabic/Hebrew Support
The telnet, tn, and tn3270 command supports the Arabic and Hebrew texts, allowing the user to type Arabic or Hebrew characters while in an emulation session. The Ar_AA locale displays the Arabic characters in their correct shapes. The following functions support the bidirectional Arabic and Hebrew texts:
Language Selection
This function allows you to toggle the language layer. Activate the Arabic/Hebrew language selection with the following key combinations:
Item | Description |
---|---|
Alt+N | From an AIX terminal |
Esc+N | From an ASCII terminal |
Alt+N or Esc+N | From a Latin AIX terminal |
Activate the Latin language layer with the following key combinations:
Item | Description |
---|---|
Alt+L | From an Arabic or Hebrew AIX terminal |
Esc+L | From an ASCII terminal |
Alt+L or Esc+L | From an AIX terminal |
Screen Reverse
This function reverses the screen image and invokes the default language of the new screen orientation. Thus, if the screen is reversed to right-to-left, the language is changed to Arabic/Hebrew. If the screen is reversed to left-to-right, the language is changed to Latin.
If symmetric character swapping is enabled, reversing the screen causes bidirectional characters to be replaced by their counterparts. For example, if numeric character swapping is enabled, reversing the screen causes Hindi numerals to be replaced by their Arabic counterparts and the Arabic numerals to be replaced by their Hindi counterparts.
Activate screen reverse with the following key combinations:
Item | Description |
---|---|
Alt+S | From an Arabic or Hebrew AIX terminal |
Esc+S | From an ASCII terminal |
Alt+S or Esc+S | From a Latin AIX terminal |
Push/End Push
The Push function allows you to edit text whose direction is opposite the screen orientation. When you activate this function, the cursor orientation is reversed, the language layer is changed accordingly, and a Push segment is created.
The Push function has two secondary modes:
Item | Description |
---|---|
Boundary Mode | This mode is activated upon entering the Push mode. In this mode, the cursor remains in its position while you type additional characters. The text is pushed in the opposite direction of the screen orientation. |
Edit Mode | This mode is activated when the cursor is moved from its boundary position into the Push segment area. In this mode, you can edit the text within the Push segment, while typing in the field's natural direction. |
Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+P | From an Arabic or Hebrew AIX terminal |
Esc+P | From an ASCII terminal |
Alt+P or Esc+P | From a Latin AIX terminal |
The End Push function terminates the Push function. The cursor jumps to the end of the Push segment and its direction changes to the original direction. You can activate End Push by pressing any field exit keys such as cursor up, cursor down, or any attention identifier (AID) key such as the Enter key. You can also activate this function with the following key combinations:
Item | Description |
---|---|
Alt+E | From an Arabic or Hebrew AIX terminal |
Esc+E | From an ASCII terminal |
Alt+E or Esc+E | From a Latin AIX terminal |
Field Reverse
This function toggles the field orientation to either the opposite of or the same as the screen orientation. This function does not invert the text in the field. The cursor orientation is set to the new field orientation and the language layer is selected accordingly.
For example, if the cursor is in the first logical position of a field or line when you activate the field reverse function, the cursor skips to the opposite side of that field or line. This position is now the first logical position. If the cursor is not in the first position of the field or line when you activate field reverse function, the cursor remains in its position and allows natural and correct editing of the existing text. Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+R | From an Arabic or Hebrew AIX terminal |
Esc+R | From an ASCII terminal |
Alt+R or Esc+R | From a Latin AIX terminal |
Autopush
This function assists you in typing mixed left-to-right and right-to-left text. When enabled, reversed segments are automatically initiated and terminated according to the typed characters or the selected language layer. Thus, this mode automatically invokes the Push mode and relieves you of invoking the Push function.
When you type a digit or Latin character in a right-to-left field, the Autopush function automatically initiates the Push function without changing the language. If you type additional digits or Latin character, the Push function continues; otherwise, the Push function automatically terminates. Thus, you can type Arabic/Hebrew text with embedded digits or Latin characters without invoking the Push/End Push functions.
When you type an Arabic/Hebrew character in a left-to-right field, the Autopush function automatically initiates the Push function without a language change. If you then type a digit or Latin character, the Autopush function automatically terminates. Thus, you can type Latin text with embedded Arabic/Hebrew text using the Language Selection function rather than the Push/End Push functions.
Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+A | From an Arabic or Hebrew AIX terminal |
Esc+A | From an ASCII terminal |
Alt+A or Esc+A | From a Latin AIX terminal |
Field Shape
This function shapes the Arabic characters in the current field or line. Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+H | From an Arabic AIX terminal |
Esc+H | From an ASCII terminal |
Alt+H or Esc+H | From a Latin AIX terminal |
Field Deshape
This function deshapes Arabic text in the current field or line. Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+B | From an Arabic AIX terminal |
Esc+B | From an ASCII terminal |
Alt+B or Esc+B | From a Latin AIX terminal |
Contextual Shape Determination
This function determines the shape of an Arabic character based on the surrounding text. Use the Contextual Shape Determination function only when typing or editing right-to-left text. This function is terminated when any of the specific shape selection keys is pressed. This is the default function. Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+C | From an Arabic AIX terminal |
Esc+C | From an ASCII terminal |
Alt+C or Esc+C | From a Latin AIX terminal |
Initial Shape Determination
This function shapes Arabic characters in their initial shapes. Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+I | From an Arabic AIX terminal |
Esc+I | From an ASCII terminal |
Alt+I or Esc+I | From a Latin AIX terminal |
Middle Shape Determination
This function shapes Arabic characters in their middle shapes. Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+M | From an Arabic AIX terminal |
Esc+M | From an ASCII terminal |
Alt+M or Esc+M | From a Latin AIX terminal |
Isolated Shape Determination
This function shapes Arabic characters in their isolated shapes. Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+O | From an Arabic AIX terminal |
Esc+O | From an ASCII terminal |
Alt+O or Esc+O | From a Latin AIX terminal |
Final Shape Determination
This function shapes Arabic characters in their final shapes. Activate this function with the following key combinations:
Item | Description |
---|---|
Alt+Y | From an Arabic AIX terminal |
Esc+Y | From an ASCII terminal |
Alt+Y or Esc+Y | From a AIX terminal |
Miscellaneous Functions
To activate numeric swapping, type the following line at the command line:
export ARB_NUM_SWAP=1
To activate symmetric swapping, that is, to swap bidirectional characters such as braces, brackets, and so on, type the following line at the command line:
export ARB_SYM_SWAP=1
To specify the code page that the host uses, type the following line at the command line:
export RM_HOST_LANG=IBM-420
Terminal Type Negotiation
The telnet command negotiates the terminal type, using the Telnet protocol, and it sets the TERM environment variable according to what has been negotiated.
To override the terminal negotiation from the console, use the EMULATE environment variable or the -e flag; or invoke the tn3270 command if you require 3270 emulation. To determine whether terminal-type negotiation is performed, the following list describes the order of the telnet command processing:
If the client and the server negotiate to use a 3270 data stream, the keyboard mapping is determined by the following precedence:
Item | Description |
---|---|
$HOME/.3270keys | Specifies the user's 3270 keyboard mapping when the tn or telnet command is invoked. If you are using a color display, you can also change this file to customize the colors for 3270 displays. |
/etc/map3270 | Specifies the user's 3270 keyboard mapping when the tn3270 command is invoked. The /etc/map3270 file defines keyboard mapping and colors for the tn3270 command. |
/etc/3270.keys | Specifies the base 3270 keyboard mapping for use with limited function terminals. |
Secure Attention Key (SAK) Option
In addition to terminal negotiation, the telnet command allows negotiation for the Secure Attention Key (SAK) option. This option, when supported, provides the local user with a secure communication path to the remote host for tasks such as changing user IDs or passwords. If the remote host supports the SAK function, a trusted shell is opened on the remote host when the telnet send sak subcommand is issued. The SAK function can also be assigned to a single key available in telnet input mode, using the set sak subcommand.
End-of-Line Convention
The Telnet protocol defines the carriage-return line-feed (CR-LF) sequence to mean "end-of-line." For terminal input, this corresponds to a command-completion or end-of-line key being pressed on a user terminal. On an ASCII terminal, this is the CR key, but it may also be labeled "Return" or "Enter."
When a Telnet server receives the Telnet end-of-line sequence, CR-LF, as input from a remote terminal, the effect is the same as if the user had pressed the end-of-line key on a local terminal.
On ASCII servers, receiving the Telnet sequence CR-LF causes the same effect as a local user pressing the CR key on a local terminal. CR-LF and CR-NUL have the same effect on an ASCII server when received as input over a Telnet connection.
Note: A Telnet user must be able to send CR-LF, CR-NULL, or LF. An ASCII user must be able to send CR-LF or CR-NULL.
A Telnet user on an ASCII host should have a user-controllable mode to send either CR-LF or CR-NULL when the user presses the end-of-line key. The CR-LF should be the default. The Telnet end-of-line sequence, CR-LF, must be used to send Telnet data that is not terminal-to-computer. This occurs, for example, when a Telnet server sends output or when the Telnet protocol incorporates another application protocol.
The telnet command "execs" (using the exec command) the /usr/sbin/login command to validate a user. This 1) allows all user and device attributes to take effect on telnet connections and 2) causes telnet connections to count against the maximum number of login sessions allowable at a time (determined by the maxlogins attribute). Attributes are defined in the /etc/security/user and /etc/security/login.cfg files.
box1=\154\161\153\170\152\155\167\165\166\164\156, batt1=f1,
box2=\154\161\153\170\152\155\167\165\166\164\156, batt2=f1md,
font0=\E(B, font1=\E(0,
The following environment variables can be used with the telnet command:
Item | Description |
---|---|
EMULATE | Overrides terminal-type negotiation in the same way as the-e flag. If the value of the EMULATE environment variable is defined as vt100 or 3270, the telnet command emulates a DEC VT100 terminal or 3270 terminal, respectively. If the EMULATE variable is not defined or has a value of none, the telnet command operates normally. If the EMULATE variable is set to vt100 or 3270, the TERM environment variable in the remote login connection should be set to the same value. You can check this by using the env command after the connection is open. |
TNESC | Specifies an alternate TELNET escape character, other than the default, Ctrl-] for the telnet command, Ctrl-T for the tn command, or Ctrl-C for the tn3270 command. To change the telnet escape sequence, set TNESC to the octal value of the character you want to use. Then export TNESC. For example, set TNESC to 35 to change the TELNET escape sequence to Ctrl-]. |
MAP3270 | Specifies an alternate file that contains the user's 3270 keyboard mapping. The MAP3270 variable must contain the full path name to the alternate file. Create the alternate file using the same format as the default /etc/map3270 file. |
RM_HOST_LANG | Specifies the EBCDIC code page being used on the remote 3270
host. Set the RM_HOST_LANG environment variable to the correct
code page before you telnet (using the telnet command) to a
non-English-speaking 3270 host. The default is English. Refer to the Converters Overview for Programming in AIX Version 7.1 National Language Support Guide and Reference for possible code
pages to use. Format the RM_HOST_LANG environment variable
by specifying the desired code page. Restriction: The tn3270 command does not support DBCS, because
terminal types for DBCS are not supported.
The telnet command converts characters by using the iconv command. Users can change the default conversion tables by using the genxlt command. |
Item | Description |
---|---|
-d | Turns debugging mode on. |
-e TerminalType | Overrides terminal-type negotiation. Possible values are vt100, 3270, or none. |
-n TraceFile | Records network trace information in the file specified by the TraceFile variable. |
-p | Preserves current TTY attributes. |
-f | Causes the credentials to be forwarded. This flag will be ignored if Kerberos 5 is not the current authentication method. Authentication will fail if the current DCE credentials are not marked forwardable. |
-F | Causes the credentials to be forwarded. In addition, the credentials on the remote system will be marked forwardable (allowing them to be passed to another remote system). This flag will be ignored if Kerberos 5 is not the current authentication method. Authentication will fail if the current DCE credentials are not marked forwardable. |
-k realm | Allows the user to specify the realm of the remote station if it is different from the local systems realm. For these purposes, a realm is synonymous with a DCE cell. This flag will be ignored if Kerberos 5 is not the current authentication method. |
-l user | Specifies the remote user the telnet wants to login as. This option is ignored if Kerberos 5 is not the current authentication method. |
Before entering each subcommand, press the escape key sequence. The escape sequence tells the program that non-text information follows. Otherwise, the program interprets subcommands as text.
For each of the subcommands in the following list, you only need to type enough letters to uniquely identify the subcommand. (For example, q is sufficient for the quit subcommand.) This is also true for the arguments to the display, emulate, mode, set, and toggle subcommands.
The telnet subcommands are:
Item | Description |
---|---|
? [Subcommand] | Requests help on telnet subcommands. Without arguments, the ? subcommand prints a help summary. If a Subcommand variable is specified, help information is displayed for that subcommand. |
close | Closes the TELNET connection and returns to telnet command mode when the open subcommand is used to establish the connection. When the telnet command is invoked and a host is specified, the close subcommand closes the TELNET connection and exits the telnet program (identical to the quit subcommand). |
display [Argument] | Displays all of the set and toggle values if no Argument variable is specified; otherwise, lists only those values that match the Argument variable. |
emulate TerminalType | Overrides terminal-type negotiation with the specified terminal
type. Possible choices are:
|
vt100 | Emulates a DEC VT100 terminal. |
Item | Description |
---|---|
mode Type | Specifies the current input mode. When the Type variable has a value of line, the mode is line-by-line. When the Type variable has a value of 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 variable is specified, the telnet subcommand attempts to contact a TELNET server at the default port. |
quit | Closes a TELNET connection and exits the telnet program. A Ctrl-D 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:
|
set VariableValue | Sets the specified TELNET variable to the specified value.
The special value off turns off the function associated with
the variable entered. The display subcommand
can be used to query the current setting of each variable. The variables
that can be specified are:
|
status | Shows the status of the telnet command, including the current mode and the currently connected remote host. |
toggle Arguments | Toggles one or more arguments that control how the telnet command
responds to events. Possible values are true and false.
Multiple arguments are separated by spaces. The display subcommand can be
used to query the current setting of each argument. The following
arguments can be used:
|
z | Suspends the TELNET process. To return to the TELNET process,
use the fg built-in command of the csh or ksh command. Note: The z subcommand has the same effect as a Ctrl-Z key sequence for any other process. It suspends Telnet execution and returns you to your original login shell. |
Authentication
If the system is configured for Kerberos 5 authentication, the telnet client will attempt authentication negotiation. The authentication negotiation used by telnet and the definitions of the options and suboptions for this are defined in rfc 1416.
If the client and server agree on an authentication type, they will exchange authentication information including the account the client wants to access. This will be the local user unless the -l flag is set.
If they cannot agree on the authentication information or if it fails, the telnet connection will continue with the standard connection (provided Standard AIX is configured).
The remote host allows access only if all of the following conditions are satisfied:
In the following examples, if you enter the tn command instead of the telnet command, the command mode prompt is displayed as tn>.
telnet host1
telnet host3
When
the login prompt appears, enter your login ID and password. Press
the Ctrl-T key sequence to receive the telnet> prompt.
Enter the following at the telnet> prompt:
Information
similar to the following is displayed on your screen: Connected to host3.
Operating in character-at-a-time mode.
Escape character is '^]'.
Upon completion of the status subcommand,
press the Enter key to return to the remote prompt.Once you have completed your login, you can issue commands. To log out of the system and close the connection, press the Ctrl-D key sequence, or exit.
tn3270 hostname
The
host login screen should be displayed. You can now enter your login
ID and password. Once you have completed your login, you can issue
commands. To log out of the system and close the connection, press
Ctrl-D or exit. To disconnect from the remote server, use the Ctrl-T key sequence.
Item | Description |
---|---|
/etc/3270.keys | Defines base 3270-keyboard mapping for use with limited function terminals. |