📄 rfc1635.txt
字号:
Network Working Group P. DeutschRequest for Comments: 1635 A. EmtageFYI: 24 BunyipCategory: Informational A. Marine NASA NAIC May 1994 How to Use Anonymous FTPStatus of this Memo This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind. Distribution of this memo is unlimited.Abstract This document provides information for the novice Internet user about using the File Transfer Protocol (FTP). It explains what FTP is, what anonymous FTP is, and what an anonymous FTP archive site is. It shows a sample anonymous FTP session. It also discusses common ways files are packaged for efficient storage and transmission.Acknowledgements This document is the result of work done in the Internet Anonymous FTP Archives (IAFA) working group of the IETF. Special thanks are due to Mark Baushke (Cisco), John Curran (BBN), Aydin Edguer (CWRU), Rafal Maszkowski (Onsala Space Observatory), Marsha Perrott (PREPnet), Bob Peterson (Texas Instruments), Nathan Torkington (Victoria University of Wellington), and Stephen Tihor (NYU) for excellent comments and contributions.What is FTP? FTP refers to the File Transfer Protocol [1], one of the protocols within the TCP/IP protocol suite used on the Internet. The File Transfer Protocol makes it possible to transfer files from one computer (or host) on the Internet to another. There are many FTP implementations built on the specification of the FTP protocol. A user of an FTP program must log in to both hosts in order to transfer a file from one to the other. It is common for a user with files on more than one host to use the FTP program to transfer files from one host to another. In this case, the user has an account on both hosts involved, so he has passwords for both hosts.IAFA Working Group [Page 1]RFC 1635 How To FTP May 1994 However, Internet users may also take advantage of a wealth of information available from archive sites by using a general purpose account called "anonymous FTP".What is an Archive Site? An archive site is a host that acts as a repository of information, much like a conventional library. Information stored on these Internet hosts is made available for users to transfer to their local sites. Users run software to identify this information and transfer it to their own hosts. Such a transfer is done with a program that implements the File Transfer Protocol (FTP).What is Anonymous FTP? Anonymous FTP is a means by which archive sites allow general access to their archives of information. These sites create a special account called "anonymous". User "anonymous" has limited access rights to the archive host, as well as some operating restrictions. In fact, the only operations allowed are logging in using FTP, listing the contents of a limited set of directories, and retrieving files. Some sites limit the contents of a directory listing an anonymous user can see as well. Note that "anonymous" users are not usually allowed to transfer files TO the archive site, but can only retrieve files from such a site. Traditionally, this special anonymous user account accepts any string as a password, although it is common to use either the password "guest" or one's electronic mail (e-mail) address. Some archive sites now explicitly ask for the user's e-mail address and will not allow login with the "guest" password. Providing an e-mail address is a courtesy that allows archive site operators to get some idea of who is using their services.What Information Do You Need to Know? To retrieve a specific file, a user needs to know what host it is on, and the pathname of the file. A pathname tells the directory (and possibly subdirectories) that house the file, and the name of the file. Often discussions of available files will not specifically say, "This file is available for anonymous FTP from X host with Y pathname". However, if a file is publicly announced as available and referred to as something like pub/good-stuff on nisc.sri.com, it is a good assumption that you can try to transfer it. You may also need to know if your machine uses an ASCII, EBCDIC, or other character set to know how likely a transfer of binary information will work, or whether such a transfer will require otherIAFA Working Group [Page 2]RFC 1635 How To FTP May 1994 keywords, such as is true for TENEX. In the general case, you may assume that an ASCII transfer will always do the right thing for plain text files. However, more and more information is being stored in various compressed formats (which are discussed later in this document), so knowing the binary characteristics of your machine may be important.A Sample Session To start an FTP session on a UNIX or VMS host, you type "ftp" and the host name or host IP address of the machine to which you want to connect. For example, if you wish to access the NASA Network Applications and Information Center archive site, you would normally execute one of the following commands at the UNIX prompt: ftp naic.nasa.gov or ftp 128.102.128.6 Observe that the first form uses the fully-qualified domain name and the second uses the Internet address for the same host. The following is an example of connecting to the naic.nasa.gov host to retrieve STD 9, RFC 959, "File Transfer Protocol (FTP)" [1]. Note several things about the session. 1. Every response the FTP program at the archive site gives is preceded by a number. These numbers are called Reply Codes and are defined in the FTP specification, RFC 959. The text that accompanies these reply codes can vary in different FTP implementations, and usually does. Also note that some FTP client implementations (e.g., MVS systems) may not echo the reply codes or text as transmitted from the remote host. They may generate their own status lines or just hide the non-fatal replies from you. For the purposes of this document, the more popular UNIX interface to the FTP client will be presented. 2. The password you type is never shown on your screen. 3. It is possible to "browse" in archives, but most often users already know the pathname of the file they want. The pathname for RFC 959 on this host is files/rfc/rfc959.txt. In theIAFA Working Group [Page 3]RFC 1635 How To FTP May 1994 example, we first connect to the 'files/rfc' directory (cd files/rfc), then get the specific file we know we want. If you do not know the name of the file you want, a file called README or something similar (00README.1ST, AAREAD.ME, INDEX, etc.) is probably the one to retrieve first. atlas.arc.nasa.gov% ftp naic.nasa.gov Connected to naic.nasa.gov. 220 naic.nasa.gov FTP server (Wed May 4 12:15:15 PDT 1994) ready. Name (naic.nasa.gov:amarine): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: 230----------------------------------------------------------------- 230-Welcome to the NASA Network Applications and Info Center Archive 230- 230- Access to NAIC's online services is also available through: 230- 230- Gopher - naic.nasa.gov (port 70) 230- World-Wide-Web - http://naic.nasa.gov/naic/naic-home.html 230- 230- If you experience any problems please send email to 230- 230- naic@nasa.gov 230- 230- or call +1 (800) 858-9947 230----------------------------------------------------------------- 230- 230-Please read the file README 230- it was last modified on Fri Dec 10 13:06:33 1993 - 165 days ago 230 Guest login ok, access restrictions apply. ftp> cd files/rfc 250-Please read the file README.rfc 250- it was last modified on Fri Jul 30 16:47:29 1993 - 298 days ago 250 CWD command successful. ftp> get rfc959.txt 200 PORT command successful. 150 Opening ASCII mode data connection for rfc959.txt (147316 bytes). 226 Transfer complete. local: rfc959.txt remote: rfc959.txt 151249 bytes received in 0.9 seconds (1.6e+02 Kbytes/s) ftp> quit 221 Goodbye. atlas.arc.nasa.gov%IAFA Working Group [Page 4]RFC 1635 How To FTP May 1994Variations The above example is of the FTP program available on UNIX systems. Other operating systems also make FTP programs available. The actual commands you type may vary somewhat with other programs. However, in general, you will do the following with every FTP program: - Log in to your local host, and invoke the FTP program. - Open a connection to the host (using either the host name or its IP address) - Once connected to the remote host, log in with username "anonymous". - Provide either the password "guest" or whatever the password the site requests. - Issue whatever FTP commands you require, such as those to change directories or to retrieve a file. - When finished, exit the FTP program, which will close your connection to the archive host.Friendly Servers These days, many sites are using a form of FTP that allows them to display several lines of explanatory text that help direct users through their archive. The listing of alternative services on naic.nasa.gov is an example. If these effusive servers confuse the client you are using, try typing a hyphen ( - ) before your password when you log in. That should disable the verbose mode of the server.Other FTP Commands We have demonstrated some of the commands available with FTP programs. Many others are possible. For example, once you have logged in to a remote host: - You may ask the FTP program to display a list of available commands, typically by invoking the FTP program without arguments and typing "help". - You may view the contents of the directory to which you are connected. Type "dir" or "ls" to do so. - You may rename a file by using the "get" command's optional local file name, which follows the remote fileIAFA Working Group [Page 5]RFC 1635 How To FTP May 1994 name on the command line. You probably should rename a file when the remote file name exceeds your local file system's naming constraints, e.g., if the remote file name is too long. An example of using the "get" command to rename a file when transferring it might be "get really-long-named-file.txt short.txt". - You may set BINARY mode to transfer executable programs or files of data. Type "binary" to do so. Usually FTP programs assume files use only 7 bits per byte, the norm for standard ASCII-encoded files. The BINARY command allows you to transfer files that use the full 8 bits per byte without error, but this may have implications on how the file is transferred to your local system. If you are not sure what format a file is in, you may need to transfer it a second time in the other mode (BINARY or ASCII) if your first guess is wrong. The extension at the end of the file name may give you a clue. File name extensions are described below. Because some machines store text files differently than others, you may have to try your luck if you're not sure what format a file is in. A good guess is to try ASCII mode first, if you have grounds to suspect the file is a text file. Otherwise, try BINARY mode. Try TENEX mode as a last resort. - You may transfer multiple files at the same time. To set this mode, type "mget". You then supply a file name pattern that the remote system understands and it tries to transfer each file in turn. If your local FTP user agent cannot transform the remote file names into legal local file names, or if there are some files that must be transferred in ASCII mode and others that must be transferred in BINARY mode, you may not be able to take advantage of this facility. Full details on the commands and options available are in the FTP documentation that comes with your system. You can also type "help" at the FTP command prompt for a list of command options. A copy of the UNIX version of the FTP documentation is available from the online manual. If your UNIX site has the manuals installed, type the following at the UNIX prompt: % man ftpIAFA Working Group [Page 6]RFC 1635 How To FTP May 1994The Packaging and Naming of Files Several widely used conventions allow for efficient storage and transmission of information stored at archive sites. Information stored on archive sites is often "transformed" in three common ways. "Compressing" (reducing the size of) the stored information makes more space available on the archive, and reduces the amount of data actually transferred across the network. "Bundling" several files into one larger file maintains the internal directory structure of the components, and allows users to transfer only one larger object rather than several (sometimes hundreds) of smaller files. In addition, binary data is often converted into an ASCII format for transmission, a process referred to in this document as "transformation". Traditionally, Internet RFC 822-based electronic mail and USENET protocols did not allow the transmission of "binary" (8-bit) data; therefore, files in binary format had to be transformed into printable 7-bit ASCII before being transmission. On many systems, various file naming conventions are used to help the remote user to determine the format of the stored information without first having to retrieve the files. Below we list the more common
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -