⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 telnet.1

📁 这是关于远程登陆TELNET 的源代码 已经测试过的。
💻 1
📖 第 1 页 / 共 2 页
字号:
.\" Copyright (c) 1983, 1990 The Regents of the University of California..\" All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\"    must display the following acknowledgement:.\"	This product includes software developed by the University of.\"	California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\"    may be used to endorse or promote products derived from this software.\"    without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"	from: @(#)telnet.1	6.16 (Berkeley) 7/27/91.\"	$Id: telnet.1,v 1.15 2000/07/30 23:57:08 dholland Exp $.\".Dd August 15, 1999.Dt TELNET 1.Os "Linux NetKit (0.17)".Sh NAME.Nm telnet.Nd user interface to the .Tn TELNETprotocol.Sh SYNOPSIS.Nm telnet.Op Fl 8ELadr.Op Fl S Ar tos.Op Fl e Ar escapechar.Op Fl l Ar user.Op Fl n Ar tracefile.Oo.Ar host.Op Ar port.Oc.Sh DESCRIPTIONThe.Nm telnetcommandis used for interactive communication with another host using the .Tn TELNETprotocol. It begins in command mode, where it prints a telnet prompt ("telnet\&> "). If.Nm telnetis invoked with a.Ar hostargument, it performs an.Ic opencommand implicitly; see the description below..PpOptions:.Bl -tag -width indent.It Fl 8Request 8-bit operation. This causes an attempt to negotiate the.Dv TELNET BINARYoption for both input and output. By default telnet is not 8-bitclean. .It Fl EDisables the escape character functionality; that is, sets the escapecharacter to ``no character''..It Fl LSpecifies an 8-bit data path on output.  This causes the .Dv TELNET BINARY option to be negotiated on just output..It Fl aAttempt automatic login.  Currently, this sends the user name via the.Ev USERvariableof the.Ev ENVIRONoption if supported by the remote system. The username is retrievedvia.Xr getlogin 3 ..It Fl dSets the initial value of the.Ic debugtoggle to.Dv TRUE..It Fl rEmulate .Xr rlogin 1 .In this mode, the default escape character is a tilde. Also, theinterpretation of the escape character is changed: an escape characterfollowed by a dot causes.Nm telnet to disconnect from the remote host. A ^Z instead of a dot suspends.Nm telnet ,and a ^] (the default.Nm telnetescape character) generates a normal telnet prompt. These codes areaccepted only at the beginning of a line. .It Fl S Ar tosSets the IP type-of-service (TOS) option for the telnetconnection to the value.Ar tos ..It Fl e Ar escapecharSets the escape character to.Ar escapechar.If no character is supplied, no escape character will be used.Entering the escape character while connected causes telnet to drop tocommand mode..It Fl l Ar userSpecify .Ar useras the user to log in as on the remote system. This is accomplished bysending the specified name as the .Dv USERenvironment variable, so it requires that the remote system support the.Ev TELNET ENVIRONoption. This option implies the.Fl aoption, and may also be used with the.Ic opencommand..It Fl n Ar tracefileOpens.Ar tracefilefor recording trace information.See the.Ic set tracefilecommand below..It Ar hostSpecifies a host to contact over the network..It Ar portSpecifies a port number or service name to contact. If not specified,the .Nm telnetport (23) is used..El.PpProtocol:.PpOnce a connection has been opened,.Nm telnetwill attempt to enable the.Dv TELNET LINEMODEoption.If this fails, then.Nm telnetwill revert to one of two input modes:either \*(Lqcharacter at a time\*(Rqor \*(Lqold line by line\*(Rqdepending on what the remote system supports..PpWhen .Dv LINEMODEis enabled, character processing is done on thelocal system, under the control of the remote system.  When inputediting or character echoing is to be disabled, the remote systemwill relay that information.  The remote system will also relaychanges to any special characters that happen on the remotesystem, so that they can take effect on the local system..PpIn \*(Lqcharacter at a time\*(Rq mode, mosttext typed is immediately sent to the remote host for processing..PpIn \*(Lqold line by line\*(Rq mode, all text is echoed locally,and (normally) only completed lines are sent to the remote host.The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be usedto turn off and on the local echo(this would mostly be used to enter passwordswithout the password being echoed)..PpIf the .Dv LINEMODEoption is enabled, or if the.Ic localcharstoggle is.Dv TRUE(the default for \*(Lqold line by line\*(Lq; see below),the user's.Ic quit  ,.Ic intr ,and.Ic flushcharacters are trapped locally, and sent as.Tn TELNETprotocol sequences to the remote side.If .Dv LINEMODEhas ever been enabled, then the user's.Ic suspand.Ic eofare also sent as.Tn TELNETprotocol sequences,and.Ic quitis sent as a .Dv TELNET ABORTinstead of .Dv BREAKThere are options (see.Ic toggle.Ic autoflushand.Ic toggle.Ic autosynchbelow)which cause this action to flush subsequent output to the terminal(until the remote host acknowledges the.Tn TELNETsequence) and flush previous terminal input(in the case of.Ic quitand.Ic intr  ) ..PpCommands:.PpThe following.Nm telnetcommands are available. Unique prefixes are understood as abbreviations..Pp.Bl -tag -width "mode type".It Ic auth Ar argument ... The.Ic authcommand controls the.Dv TELNET AUTHENTICATEprotocol option.  If .Nm telnetwas compiled without authentication, the .Ic authcommand will not be supported. Valid arguments are as follows:.Bl -tag -width "disable type".It Ic disable Ar typeDisable the specified type of authentication.  Toobtain a list of available types, use the.Ic auth disable \&?command..It Ic enable Ar typeEnable the specified type of authentication.  Toobtain a list of available types, use the.Ic auth enable \&?command..It Ic statusList the current status of the various types ofauthentication..El.PpNote that the current version of .Nm telnetdoes not support authentication..It Ic closeClose the connection to the remote host, if any, and return to commandmode..It Ic display Ar argument ... Display all, or some, of the.Ic setand.Ic togglevalues (see below)..It Ic encrypt Ar argument ...The encrypt command controls the.Dv TELNET ENCRYPTprotocol option. If .Nm telnetwas compiled without encryption, the.Ic encryptcommand will not be supported. .PpValid arguments are as follows:.Bl -tag -width Ar.It Ic disable Ar type Ic [input|output]Disable the specified type of encryption.  If you do not specify inputor output, encryption of both is disabled.  To obtain a list ofavailable types, use ``encrypt disable \&?''..It Ic enable Ar type Ic [input|output]Enable the specified type of encryption.  If you do not specify inputor output, encryption of both is enabled.  To obtain a list ofavailable types, use ``encrypt enable \&?''..It Ic inputThis is the same as ``encrypt start input''..It Ic -inputThis is the same as ``encrypt stop input''..It Ic outputThis is the same as ``encrypt start output''..It Ic -outputThis is the same as ``encrypt stop output''..It Ic start Ic [input|output]Attempt to begin encrypting.  If you do not specify input or output, encryption of both input and output is started. .It Ic statusDisplay the current status of the encryption module..It Ic stop Ic [input|output]Stop encrypting.  If you do not specify input or output, encryption ofboth is stopped..It Ic type Ar typeSets the default type of encryption to be used with later ``encrypt start''or ``encrypt stop'' commands..El.PpNote that the current version of .Nm telnetdoes not support encryption..It Ic environ Ar arguments... The.Ic environcommand is used to propagate environment variables across the .Nm telnetlink using the.Dv TELNET ENVIRONprotocol option.All variables exported from the shell are defined, but only the .Ev DISPLAYand.Ev PRINTERvariables are marked to be sent by default.  The.Ev USERvariable is marked to be sent if the.Fl aor .Fl lcommand-line options were used..PpValid arguments for the.Ic environcommand are:.Bl -tag -width Fl.It Ic define Ar variable value Define the variable.Ar variableto have a value of.Ar value.Any variables defined by this command are automatically marked forpropagation (``exported'').The.Ar valuemay be enclosed in single or double quotes sothat tabs and spaces may be included..It Ic undefine Ar variable Remove any existing definition of.Ar variable ..It Ic export Ar variable Mark the specified variable for propagation to the remote host..It Ic unexport Ar variable Do not mark the specified variable for propagation to the remotehost. The remote host may still ask explicitly for variables that arenot exported..It Ic listList the current set of environment variables.Those marked with a.Cm *will be propagated to the remote host. The remote host may still askexplicitly for the rest..It Ic \&?Prints out help information for the.Ic environcommand..El.It Ic logoutSend the.Dv TELNET LOGOUTprotocol option to the remote host.This command is similar to a.Ic closecommand. If the remote host does not support the.Dv LOGOUToption, nothing happens.  But if it does, this command should cause itto close the connection.  If the remote side also supports the conceptof suspending a user's session for later reattachment, the logoutcommand indicates that the session should be terminated immediately..It Ic mode Ar type .Ar Typeis one of several options, depending on the state of the session..Tn Telnetasks the remote host to go into the requested mode. If the remote hostsays it can, that mode takes effect..Bl -tag -width Ar.It Ic characterDisable the.Dv TELNET LINEMODEoption, or, if the remote side does not understand the.Dv LINEMODEoption, then enter \*(Lqcharacter at a time\*(Lq mode..It Ic lineEnable the.Dv TELNET LINEMODEoption, or, if the remote side does not understand the.Dv LINEMODEoption, then attempt to enter \*(Lqold-line-by-line\*(Lq mode..It Ic isig Pq Ic \-isig Attempt to enable (disable) the .Dv TRAPSIGmode of the .Dv LINEMODEoption.This requires that the .Dv LINEMODEoption be enabled..It Ic edit Pq Ic \-edit Attempt to enable (disable) the .Dv EDITmode of the .Dv LINEMODEoption.This requires that the .Dv LINEMODEoption be enabled..It Ic softtabs Pq Ic \-softtabs Attempt to enable (disable) the .Dv SOFT_TABmode of the .Dv LINEMODEoption.This requires that the .Dv LINEMODEoption be enabled..It Ic litecho Pq Ic \-litecho Attempt to enable (disable) the .Dv LIT_ECHOmode of the .Dv LINEMODEoption.This requires that the .Dv LINEMODEoption be enabled..It Ic \&?Prints out help information for the.Ic modecommand..El.It Xo.Ic open Ar host.Oo Op Fl l.Ar user.Oc Ns Oo Fl.Ar port Oc.XcOpen a connection to the named host.  If no port number is specified,.Nm telnetwill attempt to contact a.Tn telnetdaemon at the standard port (23).The host specification may be a host name or IP address.The.Fl loption may be used to specify a user name to be passed to the remotesystem, like the.Fl lcommand-line option..PpWhen connecting to ports other than the .Nm telnetport,.Nm telnetdoes not attempt .Tn telnetprotocol negotiations. This makes it possible to connect to servicesthat do not support the.Tn telnetprotocol without making a mess. Protocol negotiation can be forced byplacing a dash before the port number..PpAfter establishing a connection, any commands associated with theremote host in the user's.Pa .telnetrcfile are executed..PpThe format of the .telnetrc file is as follows: Lines beginning with a#, and blank lines, are ignored.  The rest of the file should consistof hostnames and sequences of.Nm telnetcommands to use with that host. Commands should be one per line,indented by whitespace; lines beginning without whitespace areinterpreted as hostnames. Upon connecting to a particular host, thecommands associated with that host are executed..It Ic quitClose any open session and exit.Nm telnet .An end of file condition on input, when in command mode, will triggerthis operation as well..It Ic send Ar arguments Send one or more special .Tn telnetprotocol character sequences to the remote host.  The following arethe codes which may be specified (more than one may be used in onecommand):.Pp.Bl -tag -width escape.It Ic abortSends the.Dv TELNET ABORT(Abort Processes) sequence..It Ic aoSends the.Dv TELNET AO(Abort Output) sequence, which should cause the remote system to flushall output.Em fromthe remote system.Em tothe user's terminal..It Ic aytSends the.Dv TELNET AYT(Are You There?) sequence, to which the remote system may or may notchoose to respond..It Ic brkSends the.Dv TELNET BRK(Break) sequence, which may have significance to the remotesystem..It Ic ecSends the.Dv TELNET EC(Erase Character)sequence, which should cause the remote system to erase the last characterentered..It Ic elSends the.Dv TELNET EL(Erase Line)sequence, which should cause the remote system to erase the line currentlybeing entered..It Ic eofSends the.Dv TELNET EOF(End Of File)sequence..It Ic eorSends the.Dv TELNET EOR(End of Record)sequence..It Ic escapeSends the current.Nm telnetescape character..It Ic gaSends the.Dv TELNET GA(Go Ahead)sequence, which likely has no significance to the remote system..It Ic getstatusIf the remote side supports the.Dv TELNET STATUScommand,.Ic getstatuswill send the subnegotiation to request that the server sendits current option status..It Ic ipSends the.Dv TELNET IP(Interrupt Process) sequence, which should cause the remotesystem to abort the currently running process..It Ic nopSends the.Dv TELNET NOP(No Operation)sequence..It Ic suspSends the.Dv TELNET SUSP(Suspend Process)sequence..It Ic synchSends the.Dv TELNET SYNCHsequence.This sequence causes the remote system to discard all previously typed(but not yet read) input.This sequence is sent as.Tn TCPurgentdata (and may not work if the remote system is a.Bx 4.2system -- ifit doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal)..It Ic do Ar cmd.It Ic dont Ar cmd.It Ic will Ar cmd.It Ic wont Ar cmdSends the.Dv TELNET DO.Ar cmdsequence..Ar cmdcan be either a decimal number between 0 and 255,or a symbolic name for a specific.Dv TELNETcommand..Ar cmdcan also be either.Ic helpor.Ic \&?to print out help information, includinga list of known symbolic names..It Ic \&?Prints out help information for the.Ic sendcommand..El.It Ic set Ar argument value .It Ic unset Ar argument value The.Ic setcommand will set any one of a number of.Nm telnetvariables to a specific value or to.Dv TRUE .The special value.Ic offturns off the function associated withthe variable. This is equivalent to using the.Ic unsetcommand.The.Ic unsetcommand will disable or set to

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -