📄 tyt06fi.htm
字号:
HP-UX tpci_hpws4 A.09.01 A 9000/720 (ttys2)login: tparkerpassword: xxxxxxxxtpci_hpws4-1> setenv DISPLAY tpci_server:0.0tpci_hpws4-2> <Ctrl+d>Connection closed by foreign host.tpci_server-3></FONT></PRE><P>The UNIX xhost + instruction tells the local machine to enable the remote system to control windows on the local screen (which it normally is not allowed to do). The instruction setenv DISPLAY <I>machine_name</I> executed on the remote UNIX machine sets the UNIX shell environment variable DISPLAY to the local screen. Whenever a window must be opened (as when a Motif application is run), the windowing appears on the local screen, and the processing is conducted on the remote. These examples are for UNIX, but a similar sequence works on other machines and GUIs.<BR><P>Complete applications that provide this capability to run local X and Motif windows on a Windows, Windows 95, or Windows NT machine are available from several commercial vendors. For example, Figure 6.4 shows an application running on a remote server called mandel that draws Mandelbrot figures. The server has been instructed to display the window on the local Windows for Workgroups machine using an X client package for Windows machines. The server passes all information about the size, position, and colors of the window, as well as instructions for drawing the contents to the local X client. The window appears on the Windows for Workgroups machine exactly as it would on the UNIX server.<BR><P><B><A HREF=06tyt04.gif>Figure 6.4. Using an X client to show UNIX X </B><B>windows on a PC.</A></B><BR><BR><A ID=E69E83 NAME=E69E83></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR=#FF0000><B>Telnet Commands</B></FONT></CENTER></H4><BR><P>Several service options are available when a Telnet session is established. Their values can be changed during the course of a Telnet session if both ends agree (one end might be prevented from enabling or disabling a service because of administrator or resource settings). There are four verbs used by the Telnet protocol to offer, refuse, request, and prevent services: will, won't, do, and don't, respectively. The verbs are designed to be paired (will/won't and do/don't). To illustrate how these are used, consider the following Telnet session, which has the display of these verbs turned on using the telnet command toggle options:<BR><PRE><FONT COLOR=#000080>tpci_server-1> telnettelnet> toggle optionsWill show option processing.telnet> open tpci_hpws4Trying...Connected to tpci_hpws4.Escape character is '^]'.SENT do SUPPRESS GO AHEADSENT will TERMINAL TYPE (don't reply)SEND will NAWS (don't reply)RCVD do 36 (reply)sent won't 36 (don't reply)RECD do TERMINAL TYPE (don't reply)RCVD will SUPPRESS GO AHEAD (don't reply)RCVD do NAWS (don't reply)Sent suboption NAWS 0 80 (80) 0 37 (37)Received suboption Terminal type - request to send.RCVD will ECHO (reply)SEND do ECHO (reply)RCVD do ECHO (reply)SENT won't ECHO (don't reply)HP-UX tpci_hpws4 A.09.01 A 9000/720 (ttys2)login:</FONT></PRE><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><IMG SRC=note.gif WIDTH = 75 HEIGHT = 46>The Telnet commands are used by the protocol, not by users (although you can issue them during a Telnet session, but this is usually used only for diagnostic purposes). There are no inherent Telnet user commands, other than the command mode toggle, because Telnet's role is to connect you to a remote system and let you use it directly.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><P>A partial set of Telnet command codes is shown in Table 6.1. Additional codes are used to represent printer functions such as horizontal and vertical tabs and form feeds, but these have been left off the table for brevity's sake. Part of the Telnet command code set includes six terminal functions (IP, AO, AYT, EC, EL, and GA) that are common across most terminal definitions, so they are formally defined in the Telnet standard.<BR><BR><P ALIGN=CENTER><CENTER><FONT COLOR=#000080><B>Table 6.1. Telnet command codes.</B></FONT></CENTER><BR><CENTER><TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Code</I></B></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Value</I></B></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Description</I></B></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Abort Output (AO)<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>245<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Runs process to completion but does not send the output<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Are you there (AYT)<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>246<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Queries the other end to ensure that an application is functioning<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Break (BRK)<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>243<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Sends a break instruction<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Data Mark<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>242<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Data portion of a Sync<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Do<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>253<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Asks for the other end to perform or an acknowledgment that the other end is to perform<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Don't<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>254<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Demands that the other end stop performing or confirms that the other end is no longer performing<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Erase Character (EC)<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>247<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Erases a character in the output stream<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Erase Line (EL)<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>248<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Erases a line in the output stream<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Go Ahead (GA)<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>249<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Indicates permission to proceed when using half-duplex (no echo) communications<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Interpret as Command (IAC)<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>255<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Interprets the following as a command<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Interrupt Process (IP)<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>244<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Interrupts, suspends, aborts, or terminates the process<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>NOP<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>241<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>No operation<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>SB<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>250<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Subnegotiation of an option<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>SE<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>240<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>End of the subnegotiation<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Will<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>251<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Instructs the other end to begin performing or confirms that this end is now performing<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Won't<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>252<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Refuses to perform or rejects the other end performing</FONT></TABLE></CENTER><BR><P>Telnet commands are sent in a formal package called a <I>command,</I> as shown in Figure 6.5. Typically the commands contain two or three bytes: the Interpret as Command (IAC) instruction, the command code being sent, and any optional parameter to the command. The options supported by Telnet are shown in Table 6.2.<BR><P><B><A HREF=06tyt05.gif>Figure 6.5. The Telnet command structure.</A></B><BR><BR><P ALIGN=CENTER><CENTER><FONT COLOR=#000080><B>Table 6.2. Supported Telnet option codes.</B></FONT></CENTER><BR><CENTER><TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Code</I></B></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Description</I></B></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>0<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Binary transmission<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>1<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Echo<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>2<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Reconnection<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>3<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Suppress Go Ahead (GA)<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>4<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Approximate message size negotiation<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>5<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Status<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>6<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Timing mark<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>7<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Remote controlled transmission and echo<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>8<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output line width<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>9<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output page length<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>10<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output carriage-return action<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>11<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output horizontal tab stop setting<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>12<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output horizontal tab stop action<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>13<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output form feed action<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>14<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output vertical tab stop setting<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>15<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output vertical tab stop action<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>16<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output line feed action<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>17<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Extended ASCII characters<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>18<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Logout<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>19<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Bytes macro<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>20<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Data entry terminal<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>21<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>SUPDUP<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>22<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>SUPDUP output<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>23<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Send location<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>24<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Terminal type<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>25<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>End of Record<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>26<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>TACACS user identification<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>27<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Output marking<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>28<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Terminal location number<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>29<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>3270 regime<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>30<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>X.3 PAD (Packet assembly and disassembly)<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>31<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Window size</FONT></TABLE></CENTER><BR><P>If you refer to the previous code listing with the options toggled on, some of the commands can be understood more clearly now. For example, will ECHO (which would be transmitted as values 255 251 1) instructs the other end to begin echoing back characters it receives. The command won't ECHO (the command would be 255 252 1) indicates that the sender will not echo back characters or wants to stop echoing.<BR><BLOCKQUOTE><BLOCKQUOTE><HR ALIGN=CENTER><BR><NOTE><IMG SRC=note.gif WIDTH = 75 HEIGHT = 46>The use of ASCII characters and small tables of commands and options make it relatively easy to follow Telnet communications.</NOTE><BR><HR ALIGN=CENTER></BLOCKQUOTE></BLOCKQUOTE><BR><A ID=E69E84 NAME=E69E84></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR=#FF0000><B>TN3270</B></FONT></CENTER></H4><BR><P>Many mainframes use EBCDIC, whereas most smaller machines rely on ASCII. This can cause a problem when trying to Telnet from EBCDIC-based machines to ASCII-based machines and vice-versa, because the codes being transferred are not accurate. To correct this, a Telnet application called TN3270 was developed, which provides translation between the two formats.<BR><P>When TN3270 is used to connect between two machines, Telnet itself establishes the initial connection, and then one end sets itself up for translation. If an ASCII machine is calling an EBCDIC machine, the translation between the two formats is conducted at the EBCDIC (server) end unless there is a gateway between them, in which case the gateway can perform the translation.<BR><P>Many TCP/IP application suites that include a Telnet program also include a TN3270 program. For example, Figure 6.6 shows a TN3270 window from the NetManage ChameleonNFS suite in the process of connecting to a mainframe EBCDIC-based machine. The mainframe's IP address is used to initiate the connection.<BR><P><B><A HREF=06tyt06.gif>Figure 6.6. TN3270 provides conversion between </B><B>ASCII and EBCDIC.</A></B><BR><BR><A ID=E68E60 NAME=E68E60></A><H3 ALIGN=CENTER><CENTER><FONT SIZE=5 COLOR=#FF0000><B>File Transfer Protocol (FTP)</B></FONT></CENTER></H3><BR><P><I>File Transfer Protocol,</I> usually called FTP, is a utility for managing files across machines without having to establish a remote session with Telnet. FTP enables you to transfer files back and forth, manage directories, and access electronic mail. FTP is not designed to enable access to another machine to execute programs, but it is the best utility for file transfers.<BR><P>FTP uses two TCP channels. TCP port 20 is the data channel, and port 21 is the command channel. FTP is different from most other TCP/IP application programs in that it does use two channels, enabling simultaneous transfer of FTP commands and data. It also differs in one other important aspect: FTP conducts all file transfers in the foreground, instead of the background. In other words, FTP does not use spoolers or queues, so you are watching the transfer process in real time. By using TCP, FTP eliminates the need to worry about reliability or connection management, because FTP can rely on TCP to perform these functions properly.<BR><P>In FTP parlance, the two channels that exist between the two machines are called the <I>protocol interpreter, </I>or PI, and the <I>data transfer </I><I>process,</I> or DTP. The PI transfers instructions between the two implementations using TCP command channel 21, and the DTP transfers data on TCP data channel 20. This is shown in Figure 6.7.<BR><P><B><A HREF=06tyt07.gif>Figure 6.7. FTP channel connections.</A></B><BR><P>FTP is similar to Telnet in that it uses a server program that runs continuously and a separate program that is executed on the client. On UNIX systems, these programs are named ftpd and ftp, respectively (similar to telnetd and telnet).<BR><BR><A ID=E69E85 NAME=E69E85></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR=#FF0000><B>FTP Commands</B></FONT></CENTER></H4><BR><P>Before looking at how you can use FTP to transfer files, you should look at the commands behind the protocol itself. As with Telnet's commands, these are for the protocol's use only and should not be used by a user (although administrators sometimes use the FTP commands for debugging and diagnostic purposes).<BR><P>FTP's internal protocol commands are four-character ASCII sequences terminated by a newline character. Some of the codes require parameters after them. One primary advantage to using ASCII characters for commands is that a user can observe the command flow and understand it easily. This helps considerably in the debugging process. Also, it enables a knowledgeable user to communicate directly with the FTP server component (ftpd).<BR><P>FTP commands used by the protocol are summarized in Table 6.3. These commands provide for the connection process, password checking, and the actual file transfers. These are not to be confused with the commands available to a user.<BR><BR><P ALIGN=CENTER><CENTER><FONT COLOR=#000080><B>Table 6.3. FTP internal commands.</B></FONT></CENTER><BR><CENTER><TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Command</I></B></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Description</I></B></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>ABOR<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Abort previous command<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>ACCT<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>User account ID<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>ALLO<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Allocate storage for forthcoming operation<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>APPE<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Append incoming data to an existing file<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>CDUP<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Change to parent directory<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>CWD<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Change working directory<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>DELE<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Delete file<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>HELP<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Retrieve information<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>LIST<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Transfer list of directories<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>MKD<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Make a directory<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>MODE<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Set transfer mode<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>NLST<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Transfer a directory listing<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>NOOP<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>No operation<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>PASS<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>User password<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>PASV<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Request a passive open<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>PORT<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Port address<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>PWD<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Display current directory<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>QUIT<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Terminate the connection<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>REIN<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Terminate and restart a connection<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>REST<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Restart marker (restart transfer)<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>RETR<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Transfer copy of file<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>RMD<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Remove a directory<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>RNFR<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Old pathname for rename command<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>RNTO<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>New pathname for rename command<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>SITE<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Provides service specifics<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>SMNT<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Mount a file system<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>STAT<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Returns status<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>STOR<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Accept and store data<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>STOU<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Accept data and store under different name<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>STRU<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>File structure<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>SYST<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Query to determine operating system<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>TYPE<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Type of data<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>USER<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>User ID</FONT></TABLE></CENTER><BR><P>FTP also uses simple return codes to indicate transfer conditions. Each return code is a three-digit number, the first of which signifies a successful execution (the first digit is 1, 2, or 3) or a failure (the first digit is 4 or 5). The second and third digits specify the return code or error condition in more detail. The FTP return codes are shown in Table 6.4 and Table 6.5. The third-digit codes are not included here because there are many of them and they vary between implementations.<BR><BR><P ALIGN=CENTER><CENTER><FONT COLOR=#000080><B>Table 6.4. FTP reply code first digits.</B></FONT></CENTER><BR><CENTER><TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>First Digit</I></B></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Description</I></B></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>1<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Action initiated. Expect another reply before sending a new command.<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>2<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Action completed. Can send a new command.<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>3<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Command accepted but on hold due to lack of information.<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>4<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Command not accepted or completed. Temporary error condition exists. Command can be reissued.<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>5<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Command not accepted or completed. Reissuing the command will result in the same error (don't reissue).</FONT></TABLE></CENTER><BR><BR><P ALIGN=CENTER><CENTER><FONT COLOR=#000080><B>Table 6.5. FTP reply code second digits.</B></FONT></CENTER><BR><CENTER><TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Second Digit</I></B></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P><B><I>Description</I></B></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>0<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Syntax error or illegal command<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>1<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Reply to request for information<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>2<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Reply that refers to connection management<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>3<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Reply for authentication command<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>4<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Not used<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>5<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Reply for status of server</FONT></TABLE></CENTER><BR><P>FTP enables file transfers in several formats, which are usually system-dependent. The majority of systems (including UNIX systems) have only two modes: text and binary. Some mainframe installations add support for EBCDIC, whereas many sites have a local type designed for fast transfers between local network machines (the local type might use 32- or 64-bit words).<BR><P>Text transfers use ASCII characters separated by carriage-return and newline characters, whereas binary enables transfer of characters with no conversion or formatting. Binary mode is faster than text and also enables for the transfer of all ASCII values (necessary for nontext files). On most systems, FTP starts in text mode, although many system administrators now set FTP to binary mode as a default for their users' convenience. FTP cannot transfer file permissions, because these are not specified as part of the protocol.<BR><P>Before transferring files with FTP, make sure you are using the correct transfer mode. Transferring a binary file as ASCII results in garbage! Check with your system administrator if you are unsure of the mode, or watch the messages FTP returns to see the mode used.<BR><A ID=E69E86 NAME=E69E86></A><H4 ALIGN=CENTER><CENTER><FONT SIZE=4 COLOR=#FF0000><B>FTP Connections</B></FONT></CENTER></H4><BR><P>FTP is usually started with the name or address of the target machine. As with Telnet, the name must be resolvable into an IP address for the command to succeed. The target machine can also be specified from the FTP command line. For example, to connect to the IP address 205.150.89.5, you would issue this command:<BR><BR><PRE><FONT COLOR=#000080>ftp 205.150.89.5</FONT></PRE><P>When FTP connects to the destination, you must be able to log into the system as a valid user (as you do when connecting through Telnet). Some systems enable an anonymous or guest login for FTP file transfers (usually using your login name as a password as a record of your access; see the section titled "Anonymous FTP Access"), but most require you to have regular access to the machine. The following extract shows the login process as a user provides a login and password for the remote machine:<BR><PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -