Table of Contents

NAME

telnet - User interface to the TELNET protocol

SYNOPSIS

telnet host

DESCRIPTION

The telnet command is used to communicate with another host using the TELNET protocol. If telnet is invoked without the host argument, it enters command mode, indicated by its prompt In this mode, it accepts and executes the commands listed below. If it is invoked with arguments, it performs an command with those arguments.

Options:

-d
Sets the initial value of the toggle to
-a
Attempt automatic login. Currently, this sends the user name via the variable of the option if supported by the remote system. The name used is that of the current user as returned by getlogin (2) if it agrees with the current user ID, otherwise it is the name associated with the user ID.
-n
Opens tracefile for recording trace information. See the command below.
-l
When connecting to the remote system, if the remote system understands the option, then user will be sent to the remote system as the value for the variable USER. This option implies the option. This option may also be used with the command.
-e
Sets the initial vipw telnet escape character to escape char. If escape char is ommitted, then there will be no escape character. Ar host Indicates the official name, an alias, or the Internet address of a remote host. Ar port Indicates a port number (address of an application). If a number is not specified, the default telnet port is used.

Once a connection has been opened, telnet will attempt to enable the option. If this fails, then telnet will revert to one of two input modes: either Lqcharacter at a timeRq or Lqold line by lineRq depending on what the remote system supports.

When is enabled, character processing is done on the local system, under the control of the remote system. When input editing or character echoing is to be disabled, the remote system will relay that information. The remote system will also relay changes to any special characters that happen on the remote system, so that they can take effect on the local system.

In Lqcharacter at a timeRq mode, most text typed is immediately sent to the remote host for processing.

In Lqold line by lineRq mode, all text is echoed locally, and (normally) only completed lines are sent to the remote host. The Lqlocal echo characterRq (initially Lq^ERq) may be used to turn off and on the local echo (this would mostly be used to enter passwords without the password being echoed).

If the option is enabled, or if the toggle is (the default for Lqold line by lineLq; see below), the user's and characters are trapped locally, and sent as TELNET protocol sequences to the remote side. If has ever been enabled, then the user's and are also sent as TELNET protocol sequences, and is sent as a instead of There are options (see and below) which cause this action to flush subsequent output to the terminal (until the remote host acknowledges the TELNET sequence) and flush previous terminal input (in the case of and

While connected to a remote host, telnet command mode may be entered by typing the telnet Lqescape characterRq (initially Lq^]Rq). When in command mode, the normal terminal editing conventions are available.

The following telnet commands are available. Only enough of each command to uniquely identify it need be typed (this is also true for arguments to the and commands).


Ic close Close a TELNET session and return to command mode. Ic display Ar argument ... Displays all, or some, of the and values (see below). Ic mode Ar type Type is one of several options, depending on the state of the TELNET session. The remote host is asked for permission to go into the requested mode. If the remote host is capable of entering that mode, the requested mode will be entered.
Ic character Disable the option, or, if the remote side does not understand the option, then enter Lqcharacter at a timeLq mode. Ic line Enable the option, or, if the remote side does not understand the option, then attempt to enter Lqold-line-by-lineLq mode. Ic isig Pq Ic -isig Attempt to enable (disable) the mode of the option. This requires that the option be enabled. Ic edit Pq Ic -edit Attempt to enable (disable) the mode of the option. This requires that the option be enabled. Ic softtabs Pq Ic -softtabs Attempt to enable (disable) the mode of the option. This requires that the option be enabled. Ic litecho Pq Ic -litecho Attempt to enable (disable) the mode of the option. This requires that the option be enabled. Ic ? Prints out help information for the command. Xo user port Oc Open a connection to the named host. If no port number is specified, telnet will attempt to contact a TELNET server at the default port. The host specification may be either a host name (see hosts ( 5 )) or an Internet address specified in the Lqdot notationRq (see inet (3)) . The option may be used to specify the user name to be passed to the remote system via the option. When connecting to a non-standard port, telnet omits any automatic initiation of TELNET options. When the port number is preceeded by a minus sign, the inital option negotiation is done. After establishing a connection, the file .telnetrc in the users home directory is opened. Lines begining with a # are comment lines. Blank lines are ignored. Lines that begin without whitespace are the start of a machine entry. The first thing on the line is the name of the machine that is being connected to. The rest of the line, and successive lines that begin with whitespace are assumed to be telnet commands and are processed as if they had been typed in manually to the telnet command prompt. Ic quit Close any open TELNET session and exit telnet . An end of file (in command mode) will also close a session and exit. Ic send Ar arguments Sends one or more special character sequences to the remote host. The following are the arguments which may be specified (more than one argument may be specified at a time):


Ic abort Sends the (Abort processes) sequence. Ic ao Sends the (Abort Output) sequence, which should cause the remote system to flush all output from the remote system to the user's terminal. Ic ayt Sends the (Are You There) sequence, to which the remote system may or may not choose to respond. Ic brk Sends the (Break) sequence, which may have significance to the remote system. Ic ec Sends the (Erase Character) sequence, which should cause the remote system to erase the last character entered. Ic el Sends the (Erase Line) sequence, which should cause the remote system to erase the line currently being entered. Ic eof Sends the (End Of File) sequence. Ic eor Sends the (End of Record) sequence. Ic escape Sends the current telnet escape character (initially Lq^Rq). Ic ga Sends the (Go Ahead) sequence, which likely has no significance to the remote system. Ic getstatus If the remote side supports the command, will send the subnegotiation to request that the server send its current option status. Ic ip Sends the (Interrupt Process) sequence, which should cause the remote system to abort the currently running process. Ic nop Sends the (No OPeration) sequence. Ic susp Sends the (SUSPend process) sequence. Ic synch Sends the sequence. This sequence causes the remote system to discard all previously typed (but not yet read) input. This sequence is sent as TCP urgent data (and may not work if the remote system is a BSD 4.2 system -- if it doesn't work, a lower case LqrRq may be echoed on the terminal). Ic ? Prints out help information for the command. Ic set Ar argument value Ic unset Ar argument value The command will set any one of a number of telnet variables to a specific value or to The special value turns off the function associated with the variable, this is equivalent to using the command. The command will disable or set to any of the specified functions. The values of variables may be interrogated with the command. The variables which may be set or unset, but not toggled, are listed here. In addition, any of the variables for the command may be explicitly set or unset using the and commands.
Ic echo This is the value (initially Lq^ERq) which, when in Lqline by lineRq mode, toggles between doing local echoing of entered characters (for normal processing), and suppressing echoing of entered characters (for entering, say, a password). Ic eof If telnet is operating in or Lqold line by lineRq mode, entering this character as the first character on a line will cause this character to be sent to the remote system. The initial value of the eof character is taken to be the terminal's character. Ic erase If telnet is in mode (see below), if telnet is operating in Lqcharacter at a timeRq mode, then when this character is typed, a sequence (see above) is sent to the remote system. The initial value for the erase character is taken to be the terminal's character. Ic escape This is the telnet escape character (initially Lq^[Rq) which causes entry into telnet command mode (when connected to a remote system). Ic flushoutput If telnet is in mode (see below) and the character is typed, a sequence (see above) is sent to the remote host. The initial value for the flush character is taken to be the terminal's character. Ic interrupt If telnet is in mode (see below) and the character is typed, a sequence (see above) is sent to the remote host. The initial value for the interrupt character is taken to be the terminal's character. Ic kill If telnet is in mode (see below), if telnet is operating in Lqcharacter at a timeRq mode, then when this character is typed, a sequence (see above) is sent to the remote system. The initial value for the kill character is taken to be the terminal's character. Ic lnext If telnet is operating in or Lqold line by lineLq mode, then this character is taken to be the terminal's character. The initial value for the lnext character is taken to be the terminal's character. Ic quit If telnet is in mode (see below) and the character is typed, a sequence (see above) is sent to the remote host. The initial value for the quit character is taken to be the terminal's character. Ic reprint If telnet is operating in or Lqold line by lineLq mode, then this character is taken to be the terminal's character. The initial value for the reprint character is taken to be the terminal's character. Ic start If the option has been enabled, then this character is taken to be the terminal's character. The initial value for the kill character is taken to be the terminal's character. Ic stop If the option has been enabled, then this character is taken to be the terminal's character. The initial value for the kill character is taken to be the terminal's character. Ic susp If telnet is in mode, or is enabled, and the character is typed, a sequence (see above) is sent to the remote host. The initial value for the suspend character is taken to be the terminal's character. Ic tracefile Thi is the file to which the output, caused by or tracing being will be written. If it is set to then tracing information will be written to standard output (the default). Ic worderase If telnet is operating in or Lqold line by lineLq mode, then this character is taken to be the terminal's character. The initial value for the worderase character is taken to be the terminal's character. Ic ? Displays the legal commands. Ic slc Ar state The command (Set Local Characters) is used to set or change the state of the the special characters when the option has been enabled. Special characters are characters that get mapped to TELNET commands sequences (like or or line editing characters (like and By default, the local special characters are exported.
Ic export Switch to the local defaults for the special characters. The local default characters are those of the local terminal at the time when telnet was started. Ic import Switch to the remote defaults for the special characters. The remote default characters are those of the remote system at the time when the TELNET connection was established. Ic check Verify the current settings for the current special characters. The remote side is requested to send all the current special character settings, and if there are any discrepencies with the local side, the local side will switch to the remote value. Ic ? Prints out help information for the command. Ic environ Ar arguments... The command is used to manipulate the the variables that my be sent through the option. The initial set of variables is taken from the users environment, with only the and variables being exported by default. The variable is also exported if the or options are used.
Valid arguments for the command are:
Ic define Ar variable value Define the variable variable to have a value of value. Any variables defined by this command are automatically exported. The value may be enclosed in single or double quotes so that tabs and spaces may be included. Ic undefine Ar variable Remove variable from the list of environment variables. Ic export Ar variable Mark the variable variable to be exported to the remote side. Ic unexport Ar variable Mark the variable variable to not be exported unless explicitly asked for by the remote side. Ic list List the current set of environment variables. Those marked with a * will be sent automatically, other variables will only be sent if explicitly requested. Ic ? Prints out help information for the command. Ic toggle Ar arguments ... Toggle (between and various flags that control how telnet responds to events. These flags may be set explicitly to or using the and commands listed above. More than one argument may be specified. The state of these flags may be interrogated with the command. Valid arguments are:
Ic autoflush If and are both then when the or characters are recognized (and transformed into TELNET sequences; see above for details), telnet refuses to display any data on the user's terminal until the remote system acknowledges (via a option) that it has processed those TELNET sequences. The initial value for this toggle is if the terminal user had not done an "stty noflsh", otherwise (see stty ( 1 ) .) Ic autosynch If and are both then when either the or characters is typed (see above for descriptions of the and characters), the resulting TELNET sequence sent is followed by the sequence. This procedure cause the remote system to begin throwing away all previously typed input until both of the TELNET sequences have been read and acted upon. The initial value of this toggle is Ic binary Enable or disable the option on both input and output. Ic inbinary Enable or disable the option on input. Ic outbinary Enable or disable the option on output. Ic crlf If this is then carriage returns will be sent as

<CR><LF>
If this is then carriage returns will be send as
<CR><NUL>
The initial value for this toggle is Ic crmod Toggle carriage return mode. When this mode is enabled, most carriage return characters received from the remote host will be mapped into a carriage return followed by a line feed. This mode does not affect those characters typed by the user, only those received from the remote host. This mode is not very useful unless the remote host only sends carriage return, but never line feed. The initial value for this toggle is Ic debug Toggles socket level debugging (useful only to the The initial value for this toggle is Ic localchars If this is then the and characters (see above) are recognized locally, and transformed into (hopefully) appropriate TELNET control sequences (respectively and see above). The initial value for this toggle is in Lqold line by lineRq mode, and in Lqcharacter at a timeRq mode. When the option is enabled, the value of is ignored, and assumed to always be If has ever been enabled, then is sent as and suspend are sent as see above). Ic netdata Toggles the display of all network data (in hexadecimal format). The initial value for this toggle is Ic options Toggles the display of some internal telnet protocol processing (having to do with TELNET options). The initial value for this toggle is Ic prettydump When the toggle is enabled, if is enabled the output from the command will be formated in a more user readable format. Spaces are put between each character in the output, and the begining of any TELNET escape sequence is preceeded by a '*' to aid in locating them. Ic ? Displays the legal commands. Ic z Suspend telnet . This command only works when the user is using the csh ( 1 .) Ic ! Op Ar command Execute a single command in a subshell on the local system. If is ommitted, then an interactive subshell is invoked. Ic status Show the current status of telnet . This includes the peer one is connected to, as well as the current mode. Ic ? Op Ar command Get help. With no arguments, telnet prints a help summary. If a command is specified, telnet will print the help information for just that command.

ENVIRONMENT

Telnet uses at least the and environent variables. Other envirnoment variables may be propogated to the other side via the option.

FILES


Pa ~/.telnetrc user customized telnet startup values

HISTORY

The Telnet command appeared in BSD 4.2 .

NOTES

On some remote systems, echo has to be turned off manually when in Lqold line by lineRq mode.

In Lqold line by lineRq mode or the terminal's character is only recognized (and sent to the remote system) when it is the first character on a line.


Table of Contents


www.fiveanddime.net


Google
Web www.fiveanddime.net