RFC 1635

How to Use Anonymous FTP

πŸ“… published May 1994, from ietf

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 dir or ls and boom, you see everything πŸ‘€
  • Rename a file as you grab it. The get command 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 🌈

  1. compress/uncompress πŸ—œοΈ Filenames ending in .Z usually mean the file was compressed with the standard UNIX Lempel-Ziv compress utility. There's an equivalent program called uncompress that 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.
  2. 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.
  3. 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 .atox extension.
  4. 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 .uu at the end of the file name.
  5. 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 .tar or -tar.
  6. 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 zip program end with the .zip filename extension.
  7. 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 .arc filename extension.
  8. 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.
  9. 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 unshar to decode these archives. By convention, files in this format have a filename extension of .shar.
  10. 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.
  11. 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 πŸ’–
  12. 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 zoo programs end with the .zoo filename 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 🌟
  13. 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 gzip program are by convention terminated with the .z or .gz filename extensions. The gunzip program also recognizes .tgz and .taz as shorthands for .tar.z or .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