No Names, Please
The first part of this chapter shows you how to FTP to systems where you already have an account. What about the other 99.9 percent of the hosts on the Internet, where no one has ever heard of you?You’re in luck. On thousands of systems, you can log in with the username anonymous . For the password, enter your e-mail address. (This arrangement is strictly on the honor system — if you lie, they still let you log in.) When you log in for anonymous FTP, most hosts restrict your access to only certain directories that are allowed to anonymous users. You can hardly complain, though, because anonymous FTP is provided free, out of sheer generosity.
Hello, anonymous!
When you log in, you frequently get a friendly message, like this one: 230- If your FTP client crashes or hangs shortly after login please try
230- using a dash (-) as the first character of your password. This will
230- turn off the informational messages that may be confusing your FTP
230- client.
230-
230- This system may be used 24 hours a day, 7 days a week. The local
230- time is Fri Aug 15 12:15:10 2003.
230-
230- You are user number 204 out of a possible total of 250.
230-
230- All transfers to and from wuarchive are logged. If you don’t like
230- this then disconnect now!
230-
230- Wuarchive is currently a DEC Alpha AXP 3000, Model 400. Thanks to
230- Digital Equipment Corporation for their generous support of wuarchive.
230-
230-Please read the file README
230- it was last modified on Sat May 17 15:02:13 2001 - 452 days ago
230 Guest login ok, access restrictions apply.
When you’re logged in, you use the same commands to move around and retrieve files as you always do.
Command | Description |
---|---|
get old new | Copies remote file old to local file new; can omit new if same name as old |
put old new | Copies local file old to remote file new; can omit new if same name as old |
del xxx | Deletes file xxx on remote system |
cd newdir | Changes to directory newdir on the remote machine |
cdup | Changes to next higher directory |
lcd newdir | Changes to directory newdir on the local machine |
asc | Transfers files in ASCII mode (use for text files) |
bin | Transfers files in binary or image mode (all other files) |
quit | Leaves FTP |
dir pat | Lists files whose names match pattern pat; if no pat, lists all files |
mget pat | Gets files whose names match pattern pat |
mput pat | Puts files whose names match pattern pat |
mdel pat | Deletes remote files whose names match pattern pat |
prompt | Turn name prompting on or off in mget and mput |
A few anonymous FTP tips
Here are a few items to remember when you’re FTP-ing:
Some hosts limit the number of anonymous users or the times of day that anonymous FTP is allowed. Please respect these limits because no law says that the owner of the system can’t turn off anonymous access.
Don’t store files in the other computer unless the owner invites you to do so. Usually a directory called incoming or something similar is available where you can put stuff.
Some hosts allow anonymous FTP only from hosts that have names. That is, if you try to FTP anonymously from a host that has a number but no name, these hosts don’t let you in. This problem occurs most often with personal computers, which, because they generally offer no services that are useful to other people, don’t always have names assigned. If you have that problem, check with your local administrator to see whether assigning a name to your PC is possible and to set up the reverse lookup database the remote host uses to figure out what your name is.
Network URLs for FTP-ing
URLs? Yikes! It’s that three-letter acronym from Chapter 18. More than just a way to denote hypertext Web pages, URLs are ways of naming general Internet resources, including FTP sites. Here’s the way you describe a file you can get over the Internet by using the ftp program: ftp://hostname/pathname
Suppose that you see this URL: ftp://rtfm.mit.edu/pub/net/internet.txt
That means to FTP to rtfm.mit.edu , move to the /pub/net directory, and get the internet.txt file.