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

📄 781-784.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Unleashed, Third Edition:Setting Up an FTP and Anonymous FTP Site</TITLE>

<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0672313723//-->

<!--TITLE=Linux Unleashed, Third Edition//-->

<!--AUTHOR=Tim Parker//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Sams//-->

<!--CHAPTER=48//-->

<!--PAGES=781-784//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch47/778-780.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="784-787.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 48<BR>Setting Up an FTP and Anonymous FTP Site

</FONT></H2>

<P><I>by Tim Parker</I></P>

<DL>

<DT><B>In This Chapter</B>

<DT>&#149;&nbsp;&nbsp; What is FTP?

<DT>&#149;&nbsp;&nbsp; Configuring FTP

<DT>&#149;&nbsp;&nbsp; A more secure FTP

<DT>&#149;&nbsp;&nbsp; Protecting an anonymous FTP system

</DL>

<P>Snap question: What is the most widely used TCP/IP and Internet service? If you answered FTP, you&#146;re right. (If you didn&#146;t choose FTP, this may come as a bit of a surprise. The fact is, FTP remains the most widely used service; although the World Wide Web is quickly catching up.) FTP&#146;s popularity is easy to figure: The FTP software is supplied with every version of UNIX and Linux; it&#146;s easy to install, configure, and use; and it gives users access to a wealth of information with very little effort. Lately, the popularity of the World Wide Web has made a different interface to FTP available: the Web browser. Most browsers such as Netscape Navigator allow you to use it for file transfers to FTP sites.

</P>

<P>If all you want to use FTP for is connecting to another machine and transferring files, then you don&#146;t have to do much more than enable the FTP service on your system. Much more interesting to many users is turning your Linux machine into an FTP site, where others can connect and obtain files you make available. That&#146;s the primary focus of this chapter&#151;setting up an FTP site on your Linux machine. We&#146;ll begin, though, with a quick look at using FTP and the way FTP runs on TCP. This information should help you understand how FTP works and what it does with TCP/IP.</P>

<H3><A NAME="Heading2"></A><FONT COLOR="#000077">What Is FTP?</FONT></H3>

<P>The File Transfer Protocol (FTP) is one protocol in the TCP/IP family used to transfer files between machines running TCP/IP. (FTP-like programs are also available for some other protocols, too.) The File Transfer Protocol allows you to transfer files back and forth and manage directories. FTP is not designed to allow you access to another machine to execute programs, but it is the best utility for file manipulation. To use FTP, both ends of a connection must be running a program that provides FTP services. The end that starts the connection (the client) calls the other end (the server) and establishes the FTP protocol through a set of handshaking instructions.

</P>

<P>Usually, when you connect to a remote system via FTP, you must log in. This means you must be a valid user, with a username and password for that remote machine. Because it is impossible to provide logins for everyone who wants to access a machine that enables anyone to gain access, many systems use &#147;anonymous FTP&#148; instead. Anonymous FTP enables anyone to log in to the system with the login name of &#147;ftp&#148; or &#147;anonymous&#148; with either no password or with an email address for their local system as the password.</P>

<H4 ALIGN="LEFT"><A NAME="Heading3"></A><FONT COLOR="#000077">Using FTP</FONT></H4>

<P>Using FTP to connect to a remote site is easy. You have access to the remote machine either through the Internet (directly or through a service provider) or through a local area network if the remote machine is directly reachable. To use FTP, start the FTP client software and provide the name of the remote system you want to connect to. For example, assuming you can get to the remote machine through a LAN or the Internet (which knows about the remote machine thanks to Domain Name Service), issue the following command:

</P>

<!-- CODE SNIP //-->

<PRE>

ftp chatton.com

</PRE>

<!-- END CODE SNIP //-->

<P>This instructs your FTP software to try to connect to the remote machine <TT>chatton.com</TT> and establish an FTP session.</P>

<P>When the connection is completed (and assuming the remote system allows FTP logins), the remote prompts for a userID. If anonymous FTP is supported on the system, a message usually tells you exactly that. The following is for the Linux FTP archive site <TT>sunsite.unc.edu</TT>:</P>

<!-- CODE //-->

<PRE>

ftp sunsite.unc.edu

331 Guest login ok, send your complete e-mail address as password.

Enter username (default: anonymous): anonymous

Enter password [tparker&#64;tpci.com]:

|FTP| Open

230-    WELCOME to UNC and SUN&#146;s anonymous ftp server

230-      University of North Carolina

230-      Office FOR Information Technology

230-        SunSITE.unc.edu

230 Guest login ok, access restrictions apply.

FTP&gt;

</PRE>

<!-- END CODE //-->

<P>After the login process is completed, you see the prompt <TT>FTP&gt;</TT> indicating the remote system is ready to accept commands.</P>

<P>When you log on to some systems, you may see a short message that contains instructions for downloading files, any restrictions that are placed on you as an anonymous FTP user, or information about the location of useful files. For example, you may see messages like these (taken from the Linux FTP site):</P>

<!-- CODE //-->

<PRE>

To get a binary file, type: BINARY and then: GET &#147;File.Name&#148; newfilename

To get a text file, type: ASCII and then: GET &#147;File.Name&#148; newfilename

Names MUST match upper, lower case exactly. Use the &#147;quotes&#148; as shown.

To get a directory, type: DIR. To change directory, type: CD &#147;Dir.Name&#148;

To read a short text file, type: GET &#147;File.Name&#148; TT

For more, type HELP or see FAQ in gopher.

To quit, type EXIT or Control-Z.



230- If you email to info&#64;sunsite.unc.edu you will be sent help

     &#229;information

230- about how to use the different services sunsite provides.

230- We use the Wuarchive experimental ftpd. if you &#147;get&#148;

     &#229;&lt;directory&gt;.tar.Z

230- or &lt;file&gt;.Z it will compress and/or tar it on the fly. Using &#147;.gz&#148;

     &#229;instead

230- of &#147;.Z&#148; will use the GNU zip (/pub/gnu/gzip*) instead, a superior

230- compression method.

</PRE>

<!-- END CODE //-->

<P>After you are logged on to the remote system, you can use familiar Linux commands to display file contents and move around directories. To display the contents of a directory, for example, use the command <TT>ls</TT> (some systems support the DOS equivalent <TT>dir</TT>). To change to a subdirectory, use the <TT>cd</TT> command. To return to the parent directory (the one above the current directory), use the command <TT>cd</TT>. As you can see, these commands are the same as those you use on your local machine, except you are now navigating on the remote system.</P>

<P>There are no keyboard shortcuts (such as pressing the TAB key to fill in names that match) available with FTP. This means you have to type in the name of files or directories in their entirety (and correctly). If you misspell a file or directory name, you will get error messages and have to try again. Luckily, if you are performing the FTP session through X Window, you can cut and paste lines from earlier in your session.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch47/778-780.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="784-787.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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