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

📄 tyt06fi.htm

📁 一个学习tcp/ip协议的教程
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<FONT COLOR=#000080>ftp tpci_hpws4Connected to tpci_hpws4.220 tpci_hpws4 FTP serverName (tpci_hpws4:tparker):331 Password required for tparker.Password:230 User tparker logged in.Remote system type is UNIX.Using binary mode to transfer files.</FONT></PRE><P>On large networks where a system such as Yellow Pages (YP) or Network Information Services (NIS) is used, FTP logins are usually permitted on most machines. If YP or NIS is not employed, you must be in the valid users file to obtain FTP access. As with Telnet, you can log into the remote with a different user ID from your local machine login. To transfer files, you must have the proper permissions on the remote, if file permissions are provided for by the operating system.<BR><P>After logging into another machine using FTP, you are not actually on the remote machine. You are still logically on the client, so all instructions for file transfers and directory movement must be with respect to your local machine, not the remote one. Note that this is the opposite of Telnet (a distinction that causes considerable confusion among newcomers to FTP and Telnet).<BR><P>Remember that all references to files and directories are relative to the machine that initiated the FTP session. If you are not careful, you can accidentally overwrite existing files.<P>The process followed by FTP when a connection is established is as follows:<BR><OL><LI><B>Login: </B>Verifies the user ID and password.<BR></LI><BR><LI><B>Define directory: </B>Identifies the starting directory.<BR></LI><BR><LI><B>Define file transfer mode: </B>Defines the type of transfer.<BR></LI><BR><LI><B>Start data transfer: </B>Enables user commands.<BR></LI><BR><LI><B>Stop data transfer: </B>Closes the connection.<BR></LI><BR></OL><P>The steps are performed in sequence for each connection. A user has several commands available to control FTP; the most frequently used commands are summarized in Table 6.6.<BR><BR><P ALIGN=CENTER><CENTER><FONT COLOR=#000080><B>Table 6.6. FTP user 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>FTP 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>ascii<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Switch to ASCII transfer mode<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>binary<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Switch to binary transfer mode<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>cd<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Change directory on the server<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>close<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Terminate the connection<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>del<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Delete a file on the server<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>dir<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Display the server directory<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>get<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Fetch a file from the server<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>hash<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Display a pound character for each block transmitted<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>help<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Display help<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>lcd<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Change directory on the client<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>mget<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Fetch several files from the server<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>mput<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Send several files to the server<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>open<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Connect to a server<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>put<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Send a file to the server<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>pwd<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Display the current server directory<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>quote<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Supply an FTP command directly<BR></FONT><TR><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>quit<BR></FONT><TD BGCOLOR=#80FFFF><FONT COLOR=#000080><P>Terminate the FTP session</FONT></TABLE></CENTER><BR><P>Using FTP is similar to Telnet, except that all movements of files are relative to the client. Therefore, putting a file is moving it from the client to the server, whereas getting a file is the reverse. A sample FTP session follows:<BR><PRE><FONT COLOR=#000080>tpci_hpws1-1&gt; ftp tpci_hpws4Connected to tpci_hpws4.220 tpci_hpws4 FTP server (Version 1.7.109.2 Tue Jul 28 23:32:34 GMT 1992) ready.Name (tpci_hpws4:tparker):331 Password required for tparker.Password:230 User tparker logged in.Remote system type is UNIX.Using binary mode to transfer files.ftp&gt; pwd257 &quot;/u1/tparker&quot; is current directory.ftp&gt; get mandelfile1.gifremote: mandelfile1.gif local: mandelfi.gif200 PORT command successful150 Opening BINARY mode data connection for mandelfile1.gif226 File transfer complete1192834 bytes sent in 0.89 secondsftp&gt; &lt;Ctrl+d&gt;tpci_hpws1-2&gt;</FONT></PRE><P>In this short sample, I transferred a file called mandelfile1.gif from a UNIX machine (the server) to the local machine (the client). You might have noticed that the filename was truncated automatically by the server to fit the DOS filesystem naming conventions. Also, note that I used binary mode (which was the system default). If the default had been ASCII mode, I would have just transferred over a megabyte of total garbage that couldn't be used for anything.<BR><P>A debugging option is available from the command line by adding -d to the command. This displays the command channel instructions. Instructions from the client are shown with an arrow as the first character, whereas instructions from the server have three digits in front of them. A PORT in the command line indicates the address of the data channel on which the client is waiting for the server's reply. If no PORT is specified, channel 20 (the default value) is used. Unfortunately, the progress of data transfers cannot be followed in the debugging mode. A sample session with the debug option enabled is shown here:<BR><PRE><FONT COLOR=#000080>tpci_hpws1-1&gt; ftp -dftp&gt; open tpci_hpws4Connected to tpci_hpws4.220 tpci_hpws4 FTP server Name (tpci_hpws4:tparker):

⌨️ 快捷键说明

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