Using an FTP client - Client server computing

3,789 views

Published on

How to upload and download files using an FTP client. All about the File Transfer Protocol

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,789
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
180
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Using an FTP client - Client server computing

  1. 1. File Transfer Protocol in “Client Server Computing” BY Mwendwa Kivuva [email_address] www.transworldafrica.com 16 Feb 2011 at Catholic University of Eastern Africa Main Campus, Nairobi, Kenya)
  2. 2. CONTENTS <ul><li>Introduction </li></ul><ul><li>Desired Outcomes </li></ul><ul><li>What is FTP? </li></ul><ul><li>Modes of Transfer </li></ul><ul><li>Basic Steps </li></ul><ul><li>Basic Commands </li></ul><ul><li>Transfer using GUI tools </li></ul><ul><li>Ways to Connect to FTP Servers </li></ul><ul><li>Summary </li></ul><ul><li>Terminology </li></ul>
  3. 3. INTRODUCTION <ul><li>The objectives of this FTP session are: </li></ul><ul><li>1) to demonstrate sharing of files, </li></ul><ul><li>2) to transfer data reliably and efficiently, </li></ul><ul><li>3) to explain different file viewing software. </li></ul><ul><li>4) familiarize with terminology relating to FTP </li></ul><ul><li>5) help navigate in ftp directories </li></ul><ul><li>6) Know the Basics of ftp </li></ul>
  4. 4. DESIRED OUTCOMES <ul><li>Use the FTP program. </li></ul><ul><li>Recognize different types of file extensions. E.g.: - .txt, .avi, .jpg . </li></ul><ul><li>Know how to login as “anonymous” in FTP programs </li></ul><ul><li>Know the difference between ASCII files and Binary files. </li></ul><ul><li>Know how to end an FTP session. </li></ul><ul><li>Use basic FTP commands. </li></ul><ul><li>Define FTP. </li></ul><ul><li>Know that FTP is “case sensitive” . </li></ul><ul><li>Connect to other FTP addresses and navigate in them. </li></ul><ul><li>Know you will need to have an “Anti-virus” program on your machine (**software on the net may have a virus). </li></ul>
  5. 5. WHAT IS FTP? <ul><li>FTP (RFC 959) works on the client/server principle. A client program enables the user to interact with a server in order to access information and services on the server computer. </li></ul><ul><li>Files that can be transferred are stored on computers called FTP servers . To access these files, an FTP client program is used. This is an interface that allows the user to locate the file(s) to be transferred and initiate the transfer process. </li></ul><ul><li>FTP uses two TCP Ports </li></ul><ul><ul><li>one for control (port 21) </li></ul></ul><ul><ul><li>one for data transfers (port 20) </li></ul></ul>
  6. 6. Goals of FTP <ul><li>Sharing of files </li></ul><ul><li>Indirect use of remote computers </li></ul><ul><li>Handle different file systems </li></ul><ul><li>Transfer data reliably and efficiently </li></ul>
  7. 7. MODE OF TRANSFER <ul><li>There are two modes of transfer in FTP: ascii and binary . </li></ul><ul><li>ASCII is used only for files saved in ASCII format (this includes Postcript files) </li></ul><ul><li>Binary is used for files that are formatted and saved using a wordprocessing software like WordPerfect (.txt) , spreadsheets (.xls) , images (.jpg, .gif) , and many executable programs (.exe) and videos (.avi) . </li></ul><ul><li>FTP clients select t he transfer mode automatically. </li></ul>
  8. 8. Active Mode FTP <ul><li>Client connect from a random unprivileged port (n > 1023) to the servers command port (21) and sends port command to tell server to connect to n+1 then listens on the next higher unprivileged port (n+1) for server responses. The server connects from it’s data port (20) to the client data port (n+1) </li></ul>Client Server 20 21 1026 1027 1 2 3 4
  9. 9. Passive Mode FTP <ul><li>Client opens two random unprivileged ports ( n > 1023 and n+1; ex 1026 and 1027) and connects the first port (n) to server command port 21 and issues a pasv command (server sends port to use for data); client connects to servers specified data port, server completes connection. </li></ul>Client Server 20 21 1026 1027 1 2 2024 3 4
  10. 10. Transfer Files in a Heterogeneous Host Environment <ul><li>Due to multiple hardware types and operating systems file are converted to four environmentally neutral data type for transport and the converted to local types at the destination </li></ul><ul><ul><li>ASCII A NVT-ASCII </li></ul></ul><ul><ul><li>EBCDIC E EBCDIC Text </li></ul></ul><ul><ul><li>IMAGE I Raw binary, series of octets </li></ul></ul><ul><ul><li>LOCAL L Raw binary using a variable byte size </li></ul></ul><ul><li>Client responsibility to tell server data type to use </li></ul><ul><li>Default data type, unless otherwise specified is ASCII </li></ul>
  11. 11. File Structures <ul><li>Operating System store files in different structures </li></ul><ul><li>FTP defined file structures for transporting files </li></ul><ul><ul><li>File F Unstructured, sequence of bytes </li></ul></ul><ul><ul><li>Record R Series of records </li></ul></ul><ul><ul><li>Page P Series of data blocks (pages) </li></ul></ul><ul><li>Default file structure is File (F) </li></ul><ul><li>File Structure specified using STRU command </li></ul>
  12. 12. BASIC STEPS TO USE FTP <ul><li>Connect to the FTP server </li></ul><ul><li>Navigate the file structure to find the file you want </li></ul><ul><li>Transfer the file </li></ul><ul><li>The specifics of each step will vary, depending on the client program being used and the type of Internet connection . </li></ul>
  13. 13. FTP Model User User Interface User PI User DTP Server PI Server DTP Local file system Remote file system Data Connection Control connection PI = Protocol Interpreter DTP = Data Transfer Process User FTP Server FTP
  14. 14. BASIC FTP COMMANDS <ul><li>FTP - initiate ftp session </li></ul><ul><li>open <host> - connect to an ftp server </li></ul><ul><li>binary - specify files to up/download; are more than flat text (up files, images, programs, etc.) </li></ul><ul><li>get <filename> - download a file from the server </li></ul><ul><li>put <filename> - upload a file to the server </li></ul><ul><li>close - close connection to the server </li></ul><ul><li>quit/exit - end the ftp session </li></ul><ul><li>user - re-enter login name </li></ul>
  15. 15. FTP Commands <ul><li>pwd - display present working directory on server </li></ul><ul><li>lpwd - display the local present working directory (on connecting machine) </li></ul><ul><li>cd - change directory </li></ul><ul><li>dir or ls - directory listing of files/directories on Server </li></ul><ul><li>lcd - change directory on Local Machine </li></ul><ul><li>lcd~ - home shortcut </li></ul><ul><li>mget *.* - multiple file downloads </li></ul><ul><li>mput *.* - multiple file uploads </li></ul><ul><li>cdup - to move backwards to the previous directory </li></ul>
  16. 16. Login using MSDOS
  17. 17. Typical FTP RESPONSE Scenario User FTP Server FTP (Connect to FTP server)  220 Service Ready USER username   331 User ok, password required PASS password   230 User Logged in RETR test.txt   150 Opening data connection (Server makes data connection to local host)  226 Transfer complete
  18. 18. Copy file from server <ul><li>Click on Start>Run >type CMD>Enter </li></ul><ul><li>FTP Open kenya.or.ke </li></ul><ul><li>Your login name </li></ul><ul><li>Your password </li></ul><ul><li>ftp> lcd c:filename (this is the file you want to download into. Specify location of local directory) </li></ul><ul><li>ftp> binary </li></ul><ul><li>ftp> hash (you want it “on”) just type hash at the prompt if its “off” </li></ul><ul><li>ftp> dir c* - (yes, use an asterix) </li></ul><ul><li>ftp> get <filename> </li></ul><ul><li>The file is now in your local directory </li></ul>
  19. 19. USING GUI TOOLS for FTP <ul><li>FTP clients can be interactive command-line based, or Graphical User Interface (GUI) clients for different operating systems. </li></ul><ul><li>Popular FREE and Open Source FTP GUI tools are Filezilla, cuteFTP and WinSCP. </li></ul>
  20. 20. Using WinSCP <ul><li>Download winscp from www.winscp.net </li></ul><ul><li>Open the winscp.exe program </li></ul><ul><li>Add your server details </li></ul><ul><li>Hostname: kenya.or.ke </li></ul><ul><li>Username: anonymous </li></ul><ul><li>Password: </li></ul><ul><li>Port Number: 21 </li></ul><ul><li>Protocol: FTP </li></ul><ul><li>After Login, you get a File Manager showing the Client computer, and the Server Computer </li></ul>
  21. 21. TRANSFER FILES USING GUI (WinSCP)
  22. 22. WinSCP login
  23. 23. Transfer of files using WinSCP <ul><li>Select the source file and the destination location </li></ul><ul><li>Drag the source file to the destination folder </li></ul><ul><li>To delete a file, right click on it then click delete </li></ul><ul><li>To change permissions on a file, right click on the file, then select Properties. On the permission section, tick or untick Owner, Group or Other e.g. 777 means all permissions </li></ul>
  24. 24. Copying from client to server
  25. 25. After Copy
  26. 26. Other Operations on WinSCP <ul><li>Create directory </li></ul><ul><li>List Directory Contents </li></ul><ul><li>Delete files </li></ul><ul><li>Change permissions </li></ul><ul><li>Compress and uncompress files </li></ul><ul><li>Transfer files </li></ul><ul><li>Copy and move files </li></ul>
  27. 27. CONNECT TO OTHER FTP SERVERS <ul><li>At your ftp> prompt simply type in their address. e.g. : ftp>cuea.edu </li></ul><ul><li>In Firefox, type the ftp address in the top box. e.g. : ftp://cuea.com </li></ul><ul><li>Login as “anonymous” , but be sure to give your complete e-mail address as the password. </li></ul><ul><li>Once you are at their ftp> prompt type “dir” . This will bring up their list of files for you to select from. </li></ul><ul><li>When you have chosen a file, at the ftp> prompt type - “cd pub” (or whatever) then type “dir” again. </li></ul><ul><li>Choose the particular file you want to download . </li></ul><ul><li>Set transfer mode to binary . </li></ul><ul><li>Make sure “hash” is “on” . </li></ul><ul><li>ftp> get (filename) </li></ul><ul><li>This will engage the transfer to your computer . </li></ul>
  28. 28. COMPRESSED FILES <ul><li>Sometimes you may come across files on FTP that are compressed. </li></ul><ul><li>Compression decreases the file size and enables more files to be stored on the server , and also makes file transfer times shorter. </li></ul><ul><li>To be able to use a compressed file it needs to be decompressed using compatible software . </li></ul><ul><li>Remember to keep an up-to-date version of virus checking software on your computer before you transfer files to it. </li></ul><ul><li>You can recognize a compressed file by its extension . Eg. .z, .gz, .sit, .zip. </li></ul><ul><li>Transfer these files in Binary Mode . </li></ul><ul><li>Once they are on your machine you need special software to decompress them. </li></ul><ul><li>This software are often found free on the net.. </li></ul>
  29. 29. Closing FTP Sessions <ul><li>To Logout of an FTP program you must type EXIT at the ftp> prompt. When you type CLOSE it doesn’t exit out of the FTP program. </li></ul><ul><li>When done browsing files in a remote server type: ftp>close , you will still have ftp> on your screen since you didn’t “exit” the program. You can either type “exit” or the word “open” and another FTP address . </li></ul>
  30. 30. SUMMARY <ul><li>FTP (File Transfer Protocol) enables files to be transferred from one computer to another. </li></ul><ul><li>An FTP client program is an interface that allows the user to locate file(s) to be transferred and initiate the process. </li></ul><ul><li>Through anonymous FTP , users have access to many different types of files including shareware, freeware, upgrades and documents. </li></ul><ul><li>You can transfer and view files that may aid you in writing proposals, or sending and receiving information to book vendors, and also can be used to electronically send a large document to another user without having to print it out and deliver them a hard copy. </li></ul><ul><li>Using FTP is a fun and sometimes challenging adventure. As new technology and equipment become more commonplace in our work environments , the means by which we learn and teach must evolve and change just as rapidly as the technology. </li></ul>
  31. 31. FTP TERMINOLOGY <ul><li>ASCII - American Standard Code for Information Interchange) -- Standard for the code numbers used by computers to represent all the upper and lower-case Latin letters, numbers, punctuation, tec. There are 128 standard ASCII codes each of which can be represented by a 7 digit binary number: 0000000 through 1111111. </li></ul><ul><li>BINARY - Used for files that are formatted and saved using a wordprocessing software like WordPerfect, spreadsheets, images, and many executable programs. </li></ul><ul><li>BROWSER - A program which allows a person to read hypertext. The browser gives some means of viewing the contents of nodes, and of navigating from one node to another. </li></ul><ul><li>FTP - (File Transfer Protocol)-a client program that enables the user to send files from one computer to another via the telephone network with the aid of the internet. </li></ul><ul><li>LOCAL PC - your desktop computer that you will transfer files to. </li></ul><ul><li>HOST - Any computer on a network that is a repository for services available to other computers on the network.. </li></ul><ul><li>LOGIN - The account name used to gain access to a computer system, or the act of entering into a computer system. </li></ul>
  32. 32. FTP TERMINOLOGY (CONT.) <ul><li>NODE - Any single computer connected to a network. </li></ul><ul><li>PROTOCOLS - sets of communication rules that allow clients and servers to communicate accurately with each other. </li></ul><ul><li>SERVER - A computer, or a software package, that provides a specific kind of service to client software running on other computers. </li></ul><ul><li>INTERNET - The vast collection of inter-connected networks that all use the TCP/IP protocols and that evolved from the ARPANET of the late 60’s and 70’s. </li></ul><ul><li>TCP/IP - Transmission Control Protocl/Internet Protocol -- /tus us te syute if oriticiks that defines the Internet. To be truly on the Internet, your computer must have TCP/IP software. </li></ul><ul><li>ANONYMOUS FTP - Allows a user to retrieve documents, files, programs, and other archived data from anywhere in the Internet without having to establish a userid and password. By using the special userid of “anonymous” the network user will bypass local security checks and will have access to publicly accessible files on the remote system. </li></ul><ul><li>ARCHIVE SITE - A machine that provides access to a collection of files across the Internet. </li></ul><ul><li>USER ID - On most host systems, the first time you connect you are asked to supply a one-word user name. This can be any combination of letters and numbers. This is usally also your e-mail name. </li></ul>
  33. 33. FTP TERMINOLOGY (CONT.) <ul><li>VIRUS PROGRAMS -viruses are small, invasive programs that are designed to create havoc within your computer systems. There is software to protect your computer from viruses. If you plan to swap disks with others, the first software program you should install should be a virus protection program. </li></ul><ul><li>TELNET - The command and program used to login from one Internet site to another. The telnet command/program gets you to the “login” prompt of another host. </li></ul><ul><li>CLIENT - A software program that is used to contact and obtain data from a Server software program on another computer, often across a great distance. Each Client program is designed to work with one or more specific kinds of Server programs, and each Server requires a specific kind of Client. </li></ul><ul><li>VIRUS - A program which replicates itself on computer systems by incorporating itself into other programs which are shared among computer systems. </li></ul>
  34. 34. FTP TIPS <ul><li>When retrieving non-text files , you must use Binary Mode , otherwise the file(s) get messed up. </li></ul><ul><li>FTP is case sensitive) </li></ul><ul><li>Be aware that software files on the net may have a virus . </li></ul>
  35. 35. END

×