[ Previous | Next | Contents | Home | Search ]
7318 Model S20 Guide and Reference

telnet Command (Model S20)

Purpose

Communicates with a remote host using the telnet protocol.

Syntax

telnet-8 ] [ -E ] [ -L ] [ -e EscChar ] [ -r ] [ -f ] [ HostName Port ] ]

Description

The telnet command communicates with a remote host using the telnet protocol. Issuing the telnet command without specifying the HostName parameter invokes telnet command mode and displays the telnet> command prompt. Otherwise, the telnet command connects to the specified remote host on the specified port. If you do not specify a port, the telnet command connects to the default port for the telnetd daemon.

If you issue the telnet command with flags, it performs an open subcommand with the specified flags. In command mode, the telnet command accepts and uses the flags from the following list:

Flags

-8 Uses an 8-bit data path. If you specify the -8 flag, the telnet command attempts to negotiate the BINARY option on both input and output.
-E Stops any character from being recognized as an escape character.
-e [EscChar] Sets the initial telnet escape character. If you omit the EscChar variable, there will be no predefined escape character.
-f Exits the telnet command upon returning to command mode.
-L Uses an 8-bit data path on output. If you specify the -L flag, the telnet command attempts to negotiate the BINARY option on output.
-r Uses a user interface similar to the rlogin command. In this mode, the telnet command sets the escape character to the ~ (tilde) unless modified by the -e flag.
HostName Indicates the remote host's name, which can be an alias or the Internet address.
Port Indicates a port number (for example, the address of an application). If you do not specify a number, the telnet command uses the default port for the telnetd daemon.

Use of this parameter is disallowed if the allowportswitch=0 is specified in the [TCP] section of the configuration file.

Input Modes

Once you open a connection, the telnet command enters input mode and attempts to enable the LINEMODE option. If this fails, the command reverts to one of two input modes: character-at-a-time mode or line-by-line mode. The choice depends on what the remote system supports.

When the telnet command enables the LINEMODE option, the local system processes characters while under the control of the remote system. When input editing or character echoing is disabled, the remote system relays that information. The remote system also relays changes to any special characters that happen on the remote system, so that they can take effect on the local system.

Character-at-a-time mode sends most entered text immediately to the remote host for processing.

Line-by-line mode echoes all text locally, but normally sends only completed lines to the remote host. The local ECHO character (initially Ctrl-E) enables and disables the local echo mode. Normally, you use this only for entering passwords, so that the password does not display.

If the LINEMODE option is enabled or if the localchars argument is True (the default value for the line-by-line mode), the user's QUIT, INTR, and FLUSH characters are trapped locally and sent as telnet protocol sequences to the remote machine. If the LINEMODE option was enabled at an earlier time, then the user's SUSP and EOF characters are also sent as telnet protocol sequences. The QUIT character is sent as a telnet ABORT sequence instead of the BRK (Break) sequence.

Two options, toggle autoflush and toggle autosynch, flush any subsequent output to the terminal (until the remote host acknowledges the telnet sequence) and flush previous terminal input (in the case of the QUIT and INTR characters). While connected to a remote host, you can enter command mode by typing the telnet escape character (initially Ctrl-]).

When in command mode, the normal terminal editing conventions are available. On some remote systems, the echo command must be turned off manually when in line-by-line mode. When in line-by-line mode or when the LINEMODE option is enabled, the terminal's End-of-File (EOF) character is only recognized (and sent to the remote system) when it is the first character in a line.

telnet Subcommands

The S20 7318 offers the following telnet subcommands. You need to type only enough of each subcommand to uniquely identify it (this is also true for arguments pertaining to the mode, set, toggle, unset, slc, environ, and display subcommands).

close Closes a telnet session and returns to command mode.
display Argument ... Displays all or some of the set and toggle command values.
mode [Type] Depending on the state of the telnet session, the Type parameter is one of several available options. The local host asks the remote host for permission to enter the requested mode. If the remote host is capable of entering that mode, the local host enters the requested mode.
character Disables the telnet LINEMODE option. Or, if the remote side does not understand the option, enters the character-at-a-time mode.
line Enables the telnet LINEMODE option. Or, if the remote side does not understand the telnet LINEMODE option, attempts to enter the line-by-line mode.
edit / -edit Enables or disables the EDIT mode of the LINEMODE option. The LINEMODE option must be enabled.
softtabs / -softtabs Enables or disables the SOFT_TAB mode of the LINEMODE option. The LINEMODE option must be enabled.
litecho / -litecho Enables or disables the LIT_ECHO mode of the LINEMODE option. The LINEMODE option must be enabled.
? Prints out help information for the mode command.
open Host [User] [[-]Port]
                          Opens a connection to the named host. If no port number is specified, the telnet command attempts to contact a telnetd daemon at the default port. The host specification may be either a host name or an Internet address.
quit Closes any open telnet session and exits telnet. When in command mode, an End-of-File (EOF) character also closes a session and exits.
send Arguments Sends one or more special character sequences to the remote host. You can specify the following arguments (you can specify more than one argument at a given time):
abort Sends the telnet ABORT (ABORT processes) sequence.
ao Sends the telnet AO (Abort Output) sequence, which should cause the remote system to flush all output from the remote system to the user's terminal.
ayt Sends the telnet AYT (Are You There?) sequence; the remote system may or may not respond to this transmission.
brk Sends the telnet BRK (Break) sequence, which may have significance to the remote system.
ec Sends the telnet EC (Erase Character) sequence, which should cause the remote system to erase the last character entered.
el Sends the telnet EL (Erase Line) sequence, which should cause the remote system to erase the line currently being entered.
eof Sends the telnet EOF (End-of-File) sequence.
eor Sends the telnet EOR (End-of-Record) sequence.
escape Sends the current telnet escape character (initially Ctrl-[ ).
ga Sends the telnet GA (Go Ahead) sequence, which may have no significance to the remote system.
getstatus Sends the subnegotiation request that the server should send its current option status if the remote side supports the telnet status command.
ip Sends the telnet IP (Interrupt Process) sequence, which should cause the remote system to abort the currently running process.
nop Sends the telnet NOP (No OPeration) sequence.
susp Sends the telnet SUSP (SUSPend process) sequence.
synch Sends the telnet SYNCH sequence, which causes the remote system to discard all previously typed (but not yet read) input. This sequence is sent as Transmission Control Protocol (TCP) urgent data and may not work if the remote system is a 4.2 BSD system. If the sequence does not work, a | (vertical bar) may be echoed on the terminal.
? Prints out help information for the send command.
set/unset Argument Value Sets or unsets any one of a number of telnet variables to a specific value. The set command enables (or sets to True) any of the specified functions. The off special value turns off the function associated with this variable. This is equivalent to using the unset command. The unset command disables (or sets to False) any of the specified functions. The values of variables may be interrogated using the display command.

The following variables may be set or unset, but not toggled. In addition, any of the variables for the toggle command may be explicitly enabled or disabled using the set and unset commands.

echo Toggles between local echoing of entered characters (for normal processing) and suppressed echoing of entered characters (for example, entering a password). This argument (initially Ctrl-[) only applies when in line-by-line mode.
eof Specifies the End-of-File (EOF) character. If telnet is operating in LINEMODE or in line-by-line mode, entering this character as the first character on a line sends the EOF character to the remote system. The default for the EOF character is the terminal's EOF character.
erase Specifies the ERASE character. If telnet is in localchars mode and is operating in character-at-a-time mode, entering the ERASE character sends a telnet EC sequence to the remote system. The default for the ERASE character is the terminal's ERASE character.
escape Specifies the telnet escape character (initially Ctrl-[), which causes entry into the telnet command mode when connected to a remote system.
flushoutput Specifies the FLUSHOUTPUT character. If telnet is in localchars mode, entering the FLUSHOUTPUT character sends a telnet AO sequence to the remote host. The default for the FLUSH character is the terminal's FLUSH character.
interrupt Specifies the INTERRUPT character. If telnet AO is in localchars mode, entering the INTERRUPT character sends a telnet IP sequence to the remote host. The default for the INTERRUPT character is the terminal's INTR character.
kill Specifies the KILL character. If telnet IP is in localchars mode and if telnet IP is operating in character-at-a-time mode, entering the KILL character sends a telnet EL sequence to the remote system. The default for the KILL character is the terminal's KILL character.
lnext Specifies the LNEXT character. If telnet EL is operating in LINEMODE or in line-by-line mode, the LNEXT character is the terminal's LNEXT character. The default for the LNEXT character is the terminal's LNEXT character.
quit Specifies the QUIT character. If telnet EL is in localchars mode, entering the QUIT character sends a telnet BRK sequence to the remote host. The default for the QUIT character is the terminal's QUIT character.
reprint Specifies the REPRINT character. If telnet BRK is operating in LINEMODE or in line-by-line mode, this character is the terminal's REPRINT character. The default for the REPRINT character is the terminal's REPRINT character.
start Specifies the START character. If you enable the telnet TOGGLE-FLOW-CONTROL option, this character is the terminal's START character. The default for the START character is the terminal's START character.
stop Specifies the STOP character. If you enable the telnet TOGGLE-FLOW-CONTROL option, then this character is the terminal's STOP character. The default for the STOP character is the terminal's STOP character.
susp Specifies the SUSP character. If telnet is in localchars mode or if you enable LINEMODE, entering the SUSP character sends a telnet SUSP sequence to the remote host. The default for the SUSP character is the terminal's SUSPEND character.
worderase If telnet is operating in LINEMODE or in line-by-line mode, this character is the terminal's WORDERASE character. The default for the WORDERASE character is the terminal's WORDERASE character.
? Displays the legal set and unset subcommands.
slc [State] (Set Local Characters) Sets, or changes, the state of the special characters when you have enabled telnet LINEMODE option. The special characters map to telnet command sequences (like ip or quit) or line-editing characters (like erase and kill). By default, the local special characters are exported. Valid values for the State parameter are the following:
export Switches to the local defaults for special characters. The local default characters are those of the local terminal at the time the telnet session starts.
import Switches to the remote defaults for special characters. The remote default characters are those of the remote system at the time the telnet session starts.
check Verifies the current settings for the current special characters. The local side requests the remote side to send all current special character settings. If there are any discrepancies with the local side, the local side switches to the set of remote values.
? Prints out help information for the slc subcommand.
toggle Arguments [ ... ] Toggles various flags (between True and False) that control how the telnet command responds to events. You can explicitly set these flags to True or False, using the set and unset subcommands. The toggle subcommand can take more than one argument. You can check the state of these flags, using the display subcommand. Valid arguments for the Arguments parameter are the following:
autoflush Toggles the autoflush option. If the autoflush and localchars arguments are both True, and the AO or QUIT characters are recognized and transformed into telnet sequences, the telnet command will refuse to display any data on the user's terminal until the remote system acknowledges that it has processed the telnet sequences. The remote acknowledges by using the telnet TIMING MARK option. The default for this toggle is True unless the terminal user has executed an stty noflsh command, in which case it is False. Refer to the set subcommand for more information on the AO or QUIT characters.
autosynch Toggles the autosynch option. If the autosynch and localchars arguments are both True, entering the INTR or QUIT character sends the resulting telnet sequence followed by the telnet SYNCH sequence. As a result, the remote system begins discarding all previously entered input until both of the telnet sequences have been read and acted upon. The default for this toggle is False. Refer to the set subcommand for more information on the INTR or QUIT characters.
binary Enables or disables the telnet BINARY option on both the input and output.
inbinary Enables or disables the telnet BINARY option on input.
outbinary Enables or disables the telnet BINARY option on output.
crlf Toggles the line-feed option. If this value is True, the telnet command sends a carriage return as a carriage-return and line-feed sequence. If False, the command sends a carriage return as a carriage-return and null sequence. The default for this toggle is False.
crmod Toggles the carriage-return mode option. When you enable this mode, the local host maps carriage-return characters received from the remote host into a carriage-return and line-feed sequence. This mode does not affect characters entered by the user, only those received from the remote host. This mode is not very useful unless the remote host sends carriage returns but no line feeds. The default for this toggle is False.
localchars Toggles the localchars option. If this option is True, the FLUSH, INTERRUPT, QUIT, ERASE, and KILL characters are recognized locally and then transformed into appropriate telnet control sequences (AO, IP, BRK, EC, and EL, respectively).

The default for this toggle is True in line-by-line mode and False in character-at-a-time mode. When you enable the LINEMODE option, the telnet command ignores the value of the localchars argument and assumes that it is True. If LINEMODE has ever been enabled, the QUIT character is sent as the ABORT sequence and the EOF and SUSPEND characters are sent as EOF and SUSP sequences.

options Toggles the display of some internal telnet protocol processing that pertains to telnet options. The default for this toggle is False.
prettydump Toggles the prettydump option. Enabling the NETDATA and prettydump options reorganizes the output from the netdata command into a more readable format. The telnet command separates each output character with a space and precedes the beginning of any telnet escape sequence with an * (asterisk). The * helps locate the escape sequences.
? Displays the legal toggle subcommands.
status Shows the current status of the telnet command. This includes the peer to which one is connected, as well as the current mode.
? [Command] Displays help information. If you do not specify a command, the telnet command prints a summary for the help command. If you specify a command, the telnet command prints the help information for that specific command.

[ Previous | Next | Contents | Home | Search ]