A Short Guide to Anonymous ftp Introduction A great deal of useful information is stored in files at computers throughout the country and the world. Many of these file are freely available to users of the Internet. A simple method for transferring such files from a remote computer to a users computer is anonymous ftp. Anonymous ftp allows a user to transfer files without having an account at the remote computer (i.e. the user is anonymous.) How Do I Access an Anonymous ftp site? To access an anonymous ftp site you must know the address of the site. For example, nic.ddn.mil, is the address of the Network Information Center of the Dept. of Defense Network. The procedure for accessing an anonymous ftp site follows: ================================================================== EXAMPLE: 1 & ftp nic.ddn.mil 2 Connected to nic.ddn.mil 3 220 NIC.DDN.MIL FTP Server Process 5z(47)-6 at Tue 30-Jul-91 12:56-PDT 4 Name (nic.ddn.mil:msmith) : anonymous 5 Password (nic.ddn.mil:anonymous) :--------- 6 331 ANONYMOUS user ok, send real ident as password. 7 230 User ANONYMOUS logged in at Tue 30-Jul-91 12:56-PDT, job 46. 8 ftp> ================================================================== Figure 1 Step by Step Explanation of Figure 1 1 at the Unix prompt, user ftpÕs to nic.ddn.mil 2 user is connected to ftp site 3 site notes the time of user login 4 user login as anonymous 5 user uses password of guest which does not appear on screen 6-7 system acknowledges user login and notes time 8 ftp prompt Once you have gained access to the site, the ftp> prompt returns and acknowledges that the system is ready to use. Listing the Directories and Changing Directories Once you have accessed the ftp site, to transfer a file, you may have to change directories to the directory that your file is located in. It is a good idea to list the contents of the directory before attempting to transfer a file. ================================================================== EXAMPLE: 1 230- Guest login ok, access restrictions apply. 2 Starting cwd is /pub. 3 230 Local time is: Wed Jul 31 14:18:29 1991 4 ftp> ls 5 200 PORT command successful. 6 150 Opening ASCII mode data connection for /bin/ls. 7 README 8 nic 9 security 10 sendmail 11 stats 12 sura-ops 13 surajobs 14 suranet 15 226 Transfer complete. 16 145 bytes received in 0.65 seconds (0.22 Kbytes/s) 17 ftp> cd nic 18 250 CWD command successful. 19 ftp> ls 20 200 PORT command successful. 21 150 Opening ASCII mode data connection for /bin/ls. 22 interest.groups 23 networking.terms 24 226 Transfer complete. 25 74 bytes received in 0.11 seconds (0.66 Kbytes/s) 26 ftp> get interest.groups 27 200 PORT command successful. 28 150 Opening ASCII mode data connection for interest.groups (721283 bytes). 29 226 Transfer complete. 30 local: interest.groups remote: interest.groups 31 738182 bytes received in 15 seconds (48 Kbytes/s) 32 ftp> quit 33 221 Goodbye. 34 % ================================================================== Figure 2 Step by Step Explanation of Figure 2 1-3 ftp site allows user access 4 ftp prompt: user ls (lists) possible directories 5-6 system acknowledges ls command and begins sequence 7-14 listing of directories 15-16 system completes search and notes the time the search took 17 ftp prompt: user cd (changes directory) into ÒnicÓ 18 system acknowledges change of directory 19 ftp prompt: user lists possible files under the ÒnicÓ directory 20-21 system acknowledges ls (list) command 22-23 possible files 24-25 system acknowledges search and notes time for search 26 ftp prompt: user tells system to download file "interest.groups" to his own system 27-31 system downloads file "interests.group" and notes size and time of file transfer 32 ftp prompt: user logs off ftp site 33 system acknowledges system signoff 34 Unix prompt Unix Commands for Retrieving Files Unix directories are hierarchal. In Figure 2 some simple Unix commands were used to change directories and list possible directories or files (i.e. move up or down the hierarchy.) the ls command lists the contents of the active directory the cd command enables the user to change directories (move up or down the hierarchy) the cd .. command allows the user to return to the previous directory, using this command it is possible to return to the initial directory *** Note - not all ftp sites are Unix capable**** Transferring a document It is possible to view a document while you are sill in an ftp site. The command sequence is similar to step 26 of figure 2, the difference being, a continuation of the command sequence with, |less For example: To transfer document: get To view the document while still connected to the ftp site get |less It is also possible to view the document that you have transferred into your own system after you have left the ftp site and returned to your own system. In figure 2, steps 23 and 29 show the user transferring the file and then quitting the ftp site. The transferred file is stored in the user's system under its original title. So in figure 2, the file was transferred and stored as, "interest.groups". The procedure is as follows. get "filename" "new filename" The file "filename" is stored in the users system under "new filename" To view the document transferred, use either "more" or "pg" more "filename" allows your to scroll through the document the pg "filename" command allows you to view the document one screen at a time Notes - It is generally a good idea to list the contents of possible directories before transferring a file via anonymous ftp. Names and locations of directories and files may change over time. By checking your listing of possible directories and files, you increase your chances of successfully transferring a file. - Anonymous ftp site systems sometimes acknowledge user commands with confusing responses. For example, following a change directory command, the system may respond with a comment such as, "Default name accepted Send password to connect to it." A user may find this response confusing. This is yet another reason to list, the contents of directories to determine that you have accessed the correct directory.