RFC 1635
How to Use Anonymous FTP
How to Use Anonymous FTP π
Part 1 of 3 π The sample session and the rest are coming next!
Okay bestie, the title block is giving main character energy π This is RFC 1635, titled How to Use Anonymous FTP. It was written by P. Deutsch, A. Emtage (Bunyip), and A. Marine (NASA NAIC). It's part of the Network Working Group stream, the category is Informational, and it's FYI 24, dated May 1994 πΈ The title block doesn't list anything it obsoletes or updates, so no drama there π
Status of this Memo β¨
This memo is giving info for the Internet community π It is not an Internet standard of any kind, so don't treat it as a spec π Distribution of this memo is unlimited, so share it wherever you want π¦
Abstract π
This doc is for novice Internet users who want to learn the File Transfer Protocol (FTP) π§ It explains what FTP is, what anonymous FTP is, and what an anonymous FTP archive site is. It walks through a sample anonymous FTP session, and it also covers the common ways files get packaged for efficient storage and transmission π¦
Acknowledgements π«Ά
This doc is the result of work done in the Internet Anonymous FTP Archives (IAFA) working group of the IETF. Huge thanks 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 is short for the File Transfer Protocol [1], one of the protocols in the TCP/IP protocol suite that's used on the Internet π It makes it possible to transfer files from one computer (or host) on the Internet to another. There are tons of FTP implementations built on the FTP protocol spec π» To move a file, a user of an FTP program has to log in to both hosts π
It's super common for someone with files on more than one host to use FTP to move stuff between them. In that case they have an account on both hosts, so they have passwords for both. Iykyk π
But here's the good part: Internet users can also grab a wealth of info 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, kinda like a conventional library π The info stored on these hosts is made available for users to transfer to their own local sites. You run software to find the stuff you want, then transfer it to your own host with a program that implements FTP β¨
What is Anonymous FTP? π¦
Anonymous FTP is how archive sites give general access to their archives of info π They create a special account called "anonymous". This user has limited access rights and some operating restrictions. Honestly, the only operations allowed are logging in with FTP, listing the contents of a limited set of directories, and retrieving files π Some sites also limit what an anonymous user can see in a directory listing.
Note that "anonymous" users usually aren't allowed to transfer files TO the archive site. They can only retrieve files from it π ββοΈ
Traditionally, this anonymous account accepts any string as a password π It's common to use either the password "guest" or your electronic mail (e-mail) address. Some archive sites now explicitly ask for your e-mail address and won't let you log in with the "guest" password anymore. Giving your e-mail is a courtesy that helps site operators get some idea of who's using their services π
What Information Do You Need to Know? π
To retrieve a specific file, you need to know what host it's on and its pathname πΊοΈ A pathname tells you the directory (and possibly subdirectories) that house the file, plus the name of the file. People don't usually say "this file is available for anonymous FTP from X host with Y pathname" π But if a file is publicly announced as available and referred to as something like pub/good-stuff on nisc.sri.com, it's a solid assumption that you can try to transfer it π―
You might also need to know whether your machine uses ASCII, EBCDIC, or some other character set. That tells you how likely a transfer of binary info is to work, or whether it needs other keywords, like it does for TENEX π€ In the general case, you can assume an ASCII transfer will always do the right thing for plain text files π But more and more info is stored in compressed formats (which get discussed later in this document), so knowing the binary characteristics of your machine can be super important π
Other FTP Commands β¨
Okay so we've covered some FTP commands, but there are SO many more! π Once you're logged in to a remote host, you can do stuff like:
- Ask the FTP program for a list of available commands. Usually you just start the FTP program without arguments and type
helpπ - Peek at the contents of the directory you're connected to. Type
dirorlsand boom, you see everything π - Rename a file as you grab it. The
getcommand takes an optional local file name that comes after the remote file name on the command line. You'll probably want to rename a file when the remote name is too long for your local file system's naming rules. For example:get really-long-named-file.txt short.txtπ¦ - Switch to BINARY mode so you can transfer executable programs or data files. Just type
binaryπ FTP programs usually assume files only use 7 bits per byte, which is the norm for standard ASCII-encoded files. BINARY lets you move files that use the full 8 bits per byte without errors, but it might change how the file ends up on your local system, so keep that in mind π€
If you're not sure what format a file is in, you might have to transfer it a second time in the other mode (BINARY or ASCII) if your first guess was wrong. The extension at the end of the file name can give you a clue, and we'll talk about file name extensions below πΈ
Some machines store text files differently than others, so you might just have to try your luck if you're not sure. A good guess is to try ASCII mode first if you have a reason to think the file is text. Otherwise, try BINARY mode. And if all else fails, try TENEX mode as a last resort π
- Transfer multiple files at once with
mget. You give it a file name pattern that the remote system understands, and it tries to transfer each matching file in turn π§ Heads up though: if your local FTP user agent can't turn the remote file names into legal local file names, or if some files need ASCII mode and others need BINARY mode, you might not be able to use this feature π
Full details on the commands and options 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 ftp
The Packaging and Naming of Files π
Okay, bestie, this part is lowkey so useful. Several widely used conventions make it way more efficient to store and send the info sitting on archive sites β¨
Information on archive sites often gets "transformed" in three common ways. Compressing it (shrinking its size) frees up space on the archive and cuts down how much data has to travel across the network. Bundling several files into one bigger file keeps their internal directory structure intact, and lets users grab one large object instead of several (sometimes hundreds!) of smaller files π
On top of that, binary data is often converted into an ASCII format for transmission. This document calls that "transformation" π¦ Traditionally, Internet RFC 822-based electronic mail and USENET protocols didn't allow "binary" (8-bit) data to be sent, so binary files had to be transformed into printable 7-bit ASCII before being sent π
On many systems, file naming conventions help the remote user figure out the format of stored information without having to download the files first π Below are the more common compression, bundling, and transformation conventions used on the Internet. This list isn't meant to be exhaustive, but don't worry, for every one of these, public domain or freely available implementations of the programs are out there on the network π
- compress/uncompress ποΈ Filenames ending in
.Zusually mean the file was compressed with the standard UNIX Lempel-Zivcompressutility. There's an equivalent program calleduncompressthat reverses the process and returns the file to its original state. No bundling mechanism is provided, and the results are always in binary format, no matter what format the input data was in. - atob/btoa π This one performs a transformation from ASCII to binary (
atob) and the reverse (btoa) in a standard format. Files that have been transformed this way often have filenames ending in.atob. No bundling or compression mechanisms are used. - atox/xtoa π· This is a data transformation standard for converting binary files to transferable ASCII format. It's sometimes picked over other similar mechanisms because it's more space efficient. It's not a compression mechanism per se, though. It's just more efficient at the transformation from one format to the other. Filenames of files in this format often have the
.atoxextension. - uuencode/uudecode π This transforms binary to ASCII (
uuencode) and back again (uudecode) in a standard manner. It was originally used in the UUCP ("Unix to Unix CoPy") mail/USENET system. No bundling or compression mechanisms are used. Naming conventions often add.uuat the end of the file name. - tar/untar π¦ Originally a UNIX-based utility for bundling (and unbundling) several files and directories into (and from) a single file. The acronym stands for "Tape ARchive" πΌ The standard format provides no compression mechanism, and the resulting bundled file is always in binary format, whether the constituent files are binary or not. Naming conventions usually say the filename of a "tarfile" contains the sequence
.taror-tar. - zip/unzip π€ These complementary programs were often used in IBM PC environments, and they provide both bundling and compression. The resulting files are always in binary format, and by convention files made by the
zipprogram end with the.zipfilename extension. - arc/unarc ποΈ Also popular in IBM PC environments, these complementary programs provide both bundling and compression. The resulting files are always in binary format, and files stored in this format often have a
.arcfilename extension. - binhex π Used in the Apple Macintosh environment, the binhex process provides bundling as well as binary to ASCII data transformations. By convention, files in this format have a filename extension of
.hqx. - shar π Bourne shell archives package text or binary files into a single longer file which, when executed, will create the component files. Because this format is vulnerable to misuse, most users use a special tool called
unsharto decode these archives. By convention, files in this format have a filename extension of.shar. - VMS_SHARE β οΈ DCL archives package text or binary files into a single longer file which, when executed, will create the component files. Because this format is vulnerable to misuse, care must be taken to examine such an archive before executing it. By convention, files in this format have a filename extension of
.shar. - Multipart shar/vms_share files π§© Sometimes these shell archive files are broken into multiple small parts to make them easier to transfer over other kinds of fileservers that share the same archive tree. In those cases, the parts are usually suffixed with a part number (for example
xyz.01 xyz.02 xyz.03 ..., or even.01-of-05). Collect all the parts, concatenate them on your local system, and then apply the procedure above for a simple shar or vms_share file to the concatenated file you just made π - zoo π¦ The zoo program handles compression/decompression and bundling/unbundling in a single program. Utilities that support the zoo format exist on a wide variety of systems, including Unix, MS-DOS, Macintosh, OS/2, Atari ST, and VAX VMS. Files created by the
zooprograms end with the.zoofilename extension by convention. Zoo is a popular distribution format because free implementations (both source and executable code) are available on a wide variety of operating systems π - gzip/gunzip π The Free Software Foundation's GNU project adopted a variant of the zip compression mechanism as a substitute for the compress/uncompress commands. The resulting files are always in binary format. Files made by the
gzipprogram are by convention terminated with the.zor.gzfilename extensions. The gunzip program also recognizes.tgzand.tazas shorthands for.tar.zor.tar.Z. Plus, gunzip can recognize and decompress files created by the gzip, zip, compress, or pack commands π
The GNU project recently began distributing and using the gzip/gunzip utilities. Even more recently, they changed the default suffix from .z to .gz, in an attempt to (1) reduce confusion with .Z, and (2) eliminate a problem with case-insensitive file systems such as MS-DOS π The gzip software is freely redistributable and has been ported to most UNIX systems, as well as Amiga, Atari, MSDOS, OS2, and VMS systems.
Sometimes a series of the above processes gets run to produce the final file as stored on the archive. When multiple transformation processes are used, tradition says the original (base) filename gets changed to reflect them, and the matching filename extensions get added in the order the processes were performed π§ For example, a common procedure is to first bundle the original files and directories using tar, then compress the bundled file. Starting with a base file name of foobar, the file name on the archive would become foobar.tar.Z. Since that's a binary file, it would need a further transformation into printable ASCII by a program such as uuencode to be sent over traditional email or USENET, so it might finally be called foobar.tar.Z.uu. π
β¨
Some operating systems can't handle multiple periods. In those cases, the periods are often replaced by a hyphen ( - ), an underscore ( _ ), or by detailed instructions in the "read me" files in the directories π«Ά
Compress and Tar π
okay so bestie, let's do a real example π
Say you want a super useful public domain program called "patch" for applying program patches and updates. You find it on an archive site as patch.tar.Z. The .Z means it was squished with the UNIX compress command, and the .tar means it was bundled up with the UNIX tar (tape archive) command. Two layers, very cute, very organized π¦
First, grab the file over anonymous FTP. To unpack it, you start by uncompressing it:
uncompress patch.tar.Z
This uncompresses the file and renames it to patch.tar in the process β¨ Next, you run tar to pull out the individual files:
%tar xvf patch.tar
The x argument tells tar to extract the files, and the f argument says which file to pull them from (patch.tar). The v (verbose) argument makes tar print the name of each file as it comes out, which is so satisfying to watch πΈ When tar finishes, all the files that make up the "patch" program should be sitting in your working directory. Iconic π
Etiquette π
bestie, this part is important, so read it like it's your favorite song π«Ά
First, not every site that supports FTP allows anonymous transfers. It is wrong to try to grab files from a system that has not advertised that it offers this service. No sneaking in, periodt π ββοΈ
Next, remember that the Internet site administrators running archive sites did it out of a sense of community. They are rarely paid anywhere near enough for all the time and effort it takes to keep those sites running π Users can make the admins' lives easier in small ways, like checking with local support people first if something goes wrong, before bugging the archive administrator for help.
Also, most archive machines do other jobs too. Please respect the needs of their main users and keep your FTP access to non-prime hours (generally between 1900 and 0600 hours local time for that site) whenever you can. This matters extra if the site is on another continent or across a big body of water, because those links are usually slow and heavily loaded π
Some sites offering anonymous FTP also limit how many anonymous logins can happen at once. If you try to log in and get an error saying too many anonymous FTP users are online, wait a while before trying again instead of retrying right away. Patience is a whole aesthetic π§
To cut down on redundant storage, find out how you can make the files you fetch with FTP available to your whole organization. If you grab a program, test it, and it turns out to be useful, you should probably ask your administrator to think about making it generally available. That way, people aren't all installing the same package in their own personal directories, which wastes effort and disk space π
Finally, if you find an interesting file or program on an archive site, tell others about it π£ You should not copy that file or program to your own archive unless you're willing to keep your copy current. Otherwise it just goes stale and nobody wants that energy π
References π
[1] Postel, J., and J. Reynolds, "File Transfer Protocol (FTP)", STD 9, RFC 959, USC/Information Sciences Institute, October 1985.
Security Considerations π
Security issues are not discussed in this memo. π Bestie, that's the whole entry, so keep your own security habits sharp when you're poking around archive sites π
Authors' Addresses π¦
Here's who wrote this, with all their contact info exactly as listed:
Peter Deutsch
Bunyip Information Systems
266 Blvd. Neptune
Dorval, Quebec, H9S 2L4
Canada
Phone: (514) 398-3709
EMail: peterd@bunyip.com
Alan Emtage
Bunyip Information Systems
266 Blvd. Neptune
Dorval, Quebec, H9S 2L4
Canada
Phone: (514) 398-3709
EMail: bajan@bunyip.com
April N. Marine
NASA NAIC
M/S 204-14
Ames Research Center
Moffett Field, CA 94035-1000
Phone: (415) 604-0762
EMail: amarine@atlas.arc.nasa.gov
The end, bestie! πβ¨
π¦ where this page comes from
- ietf: rfc1635 1994-05
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms