I have tried to do the whole assignment but i am stuck. i was able to download t
ID: 666002 • Letter: I
Question
I have tried to do the whole assignment but i am stuck. i was able to download the file and log into the private ftp, but then when i try to put the files into the directory ~/UnixCourse/ftpAsst it wont work. may be i am not writting the file name correctly. I am lost when it comes to where would the computer more likely store the file that i downloaded because it doesnt say . help please..
THE ASSIGNMENT:
In your Unix account, create the directory ~/UnixCourse/ftpAsst
From the Windows PC, use ftp to do an anonymous login to ftp.cs.odu.edu, and download the file /pub/zeil/cs252/shakespeare.exe into some convenient directory (folder) on the PC.
shakespeare.exe is a self-extracting zip archive. Execute it and take note of the new files created. Examine them, if you like. (If you get the error message “This program cannot be executed in DOS mode.”, your transfer was garbled, probably because you forgot abouttransfer modes.)
Using ftp or sftp, do a private transfer to upload the two files hamlet.txt and macbeth.docinto the directory ~/UnixCourse/ftpAsst.
Open up an ssh session connected to one of the CS Linux servers and give the command
Explanation / Answer
When you connect to an FTP server, you will be prompted for a login name and password. Thus, in the “normal” mode of FTP, you must have an account on the server system.
But some servers also have been set up to provide files to the public at large. By convention, servers that allow this do so by recognizing a special login name, “anonymous”, for which almost any password is accepted. Again, by convention, users who log in as “anonymous” are expected to supply their own email address as the password.
You can use web browsers to do anonymous ftp downloads. If you want to find, for example, a file named foo.txt in directory /pub/repository/textfiles/ on an ftp server <url>ftp.server.net</url>, you can direct a web browser to <url>ftp://ftp.server.net/pub/repostory/textfiles/foo.txt</url> to view the file immediately, or to <url>ftp://ftp.server.net/pub/repostory/textfiles/</url> to view the directory, after which you can right-click on the desired file and select an optin to save it on your local machine.
A web brwoser directed to an <url>ftp://</url> URL will do an anonymous ftp login on your behalf.
On the CS Dept server, ftp.cs.odu.edu, you can use <url>ftp://</url> URLs or you can log in as “anonymous” to gain access to the public area. You cannot, however, access your own files from there.
Alternatively, you can log in with your own Unix account login name and password, in which case you will have access to your own files and directories on the Unix network, but cannot access the public area.
To transfer files via FTP, you need to have an FTP client program on the machine at which you are sitting. In a sense, this is very similar to ssh, where you run an “ssh client” program on your local machine and use it to issue commands to a remote ssh server. For that matter, it's not unlike fetching a web page from a remote web server, which requires you to run a web client (a.k.a., a browser) on your local machine. The ftp client program also runs on your local machine and allows you to issue commands to a remote one, but these commands are all related to file transfers.
Not surprisingly, the way you actually launch and run the client depends upon just which client you have. Most versions of MS Windows comes with an FTP client, called ftp. This is a bare-bones, text interface version of FTP. It lacks proper support "passive mode", an underlying part of the FTP protocol for working through firewalls and/or routers on many local networks.
The CygWin project and the author of PuTTY provides similar FTP clients, which uses the same text-based interface. Both will work through common firewall/router setups.
There are a variety of FTP clients, commercial and freeware, that offer GUI ("Graphic User Interface) displays. You'll find some recommended ones listed on the course Library page.
GUI interfaces can simplify FTP use, but these interfaces may create problems by hiding the text/binary settings, leading to corrupt transfers. Still, you may find the GUI-based packages recommended on the Library pages much easier to work with.
To use the MS Windows ftp, click the “Start” button, select “Run” , and for the program name type
(Assuming you want to connect to the CS Dept. server. If you have reason to access another FTP server, just replace the machine name accordingly.)
If you are running the CygWin ftp, just type the same command into your shell.
You will then be prompted for your login name and your password. Enter those as usual.
Your next command should be
This simply increases the amount of feedback you get about the progress made during file transfers.
Before actually transferring files, you must decide whether to use binary or text file transfer. If you want binary transfers, give the command
and if you want text transfers, give the command
You can switch back and forth between these modes as necessary if you are transferring multiple files, some text and some binary.
Now you can use the commands cd, pwd, and ls to navigate the Unix directory structure as if you were in the shell. Usually, you will cd to the directory of the remote machine in which you wish to download or upload files, do an ls to see what's there, and then proceed to transfer the specific files.
You can also change the directory of the local machine in which you will be working by giving the lcd (local cd ) command. Note that the directory you give to this command must make sense in terms of the local machine's directory structure. For example,
for the MS Windows ftp client, but
under CygWin.
To get a file from the remote FTp server to your local machine, the command is
To put a file form your local machine onto the remote FTP server, the command is
Neither the get nor put commands can include wildcards ( * ? ) in the filename, but by changing the commands to mget and mput, you are allowed to use wild cards.[2]
To end your ftp session, the command is
Here, then, is an example of an ftp session in which three files were downloaded from ~zeil/data on the Unix network into c:misc emp on the local PC: