ftp_presentation.ppt

52
File Transfer Protocol War College Hellenic Air Force

Transcript of ftp_presentation.ppt

Page 1: ftp_presentation.ppt

File Transfer Protocol

War College

Hellenic Air Force

Page 2: ftp_presentation.ppt

FTP (file transfer protocol)• Πως χρησιμοποιείται ;• Μπορούμε να χρησιμοποιήσουμε την υπηρεσία ftp για τις εξής περιπτώσεις:• Μεταφορά αρχείων από έναν κεντρικό υπολογιστή στον οποίον ο χρήστης

έχει δικαίωμα πρόσβασης (account), σε έναν άλλον κεντρικό υπολογιστή στον οποίον ο χρήστης επίσης έχει δικαίωμα πρόσβασης.

• Μεταφορά αρχείων από έναν κεντρικό υπολογιστή στον οποίον ο χρήστης έχει δικαίωμα πρόσβασης (account), στον σκληρό δίσκο του προσωπικού του υπολογιστή ή σε δισκέτα και το αντίστροφο.

• Χρήση του ανώνυμου ftp (anomynous ftp), υπηρεσία που χρησιμοποιείται για τη μεταφορά αρχείων από συγκεκριμένους κεντρικούς υπολογιστές, οι οποίοι επιτρέπουν για το σκοπό αυτό την δημόσια προσπέλαση. Ο χρήστης δεν πρέπει απαραίτητα να έχει προσωπικό λογαριασμό για να συνδεθεί με έναν anonymous ftp server, αλλά έχει τη δυνατότητα πρόσβασης χρησιμοποιώντας για όνομα σύνδεσης το anonymous και για password συνήθως την ηλεκτρονική διεύθυνσή του (e-mail).

Page 3: ftp_presentation.ppt

Overview• File Transfer Protocol

• FTP’s connections• FTP commands• FTP in action• Data Representation• Limitations and future of FTP

• Trivial File Transfer Protocol•FTP and TFTP compared

Page 4: ftp_presentation.ppt

File Transfer Protocol• Provides reliable transfer of files:

• Between different hosts running on different platforms MS Windows, Apple Mac,

Sun, BSD UNIX, SCO UNIX, Linux• Using different file structures• Supports ASCII and binary content

Page 5: ftp_presentation.ppt

Important RFCs• RFC854: The Telnet Specification

- Used (Minimally) by FTP to send commands• RFC959: The File Transport Protocol

- Basic FTP definition• RFC1350: The TFTP Protocol (Rev. 2)

- “Trivial” file transfer, a subset of FTP• RFC2228: FTP Security Extensions

- Extends RFC959 to include• Authentication, confidentiality, FT encodings

• RFC2577: FTP Security Considerations- An overview of FTP vulnerabilities

Page 6: ftp_presentation.ppt

The FTP Model

Server PIServer PI

FileFileSystemSystem

User InterfaceUser Interface

User PIUser PI

UserUser

User DTPUser DTPServer DTPServer DTP FileFileSystemSystem

DataData

ControlControl

PI: Protocol InterpreterPI: Protocol InterpreterDTP: Data Transfer ProtocolDTP: Data Transfer Protocol

Page 7: ftp_presentation.ppt

Control and Data Connections

• Control functions (commands) and reply codes are transferred over the control connection.

• All data transfer takes place over the data connection.

• The control connection must be “up” while data transfer takes place.

Page 8: ftp_presentation.ppt

Control Connection

• The control connection is the “well known” service.

• The control connection uses the TELNET protocol.

• Commands and replies are all line oriented text (default is ASCII).

Page 9: ftp_presentation.ppt

Standard Connection Model

ControlControl

DataDataAA BB

Page 10: ftp_presentation.ppt

Alternative Connection ModelControlControl

DataData

AA

BB CC

ControlControl

Page 11: ftp_presentation.ppt

FTP’s Connections

UserInterface

User Data Transfer

Function

UserProtocol

Interpreter

ServerProtocol

Interpreter

Server Data Transfer

Function

client

server

ControlConnection

DataConnection

* Insulates users from “raw” FTP commandsServer is listening on port 21for connection requests

* Routes “raw” FTP commands * Receives server’s replies

* Persistent command and reply connection

Non-persistent data connection

21

20

*Server uses port 20for data connections

Page 12: ftp_presentation.ppt

FTP’s Connections

UserInterface

User Data Transfer

Function

UserProtocol

Interpreter

ServerProtocol

Interpreter

Server Data Transfer

Function

client

server

ControlConnection

DataConnection

2

ftp> ren.eecis.udel.eduConnected to ren220 ren FTP server ready.Name (ren:umakanth):

USER fisherman

ServerProtocol

Interpreter

UserProtocol

Interpreter

331 Password req for fisherman.Password:

PASS *********

230 User fisherman logged in.ftp> ls myProg.c

Bind toPort 58311

PORT 192,168,0,2,227,199200 PORT command successful.LIST myProg.c

Connect to client PORT

Server Data Transfer

Function

User Data Transfer

Function

150 Opening ASCII mode data connection for /bin/ls.

TerminateConnectionUser

Data Transfer Function

226 Transfer complete-rwxr-xr-x fisherman myProg.c

Server Data Transfer

Function

Page 13: ftp_presentation.ppt

FTP Client Commands

Command Descriptionget filename Retrieve file from server

mget filename* Retrieve multiple files from server

put filename Copy local file to server

mput filename* Copy multiple local files to server

open server Begin login to server

bye / close / exit Logoff server

ls / dir List files in current remote dir on server

lcd Change local directory

cd Change remote directory

rhelp / remotehelp

Page 14: ftp_presentation.ppt

A-PDU FTP Commands

Command DescriptionABOR Abort previous FTP command and

any data transferLIST [filelist ] List files or directories (ls / dir)

PASS password Password on server

PORT n1,n2,n3,n4,n5,n6

Client IP and port number

RETR filename Retrieve (get) filename

STOR filename Store (put) filename

NOOP Do nothing (check if server is alive)

Page 15: ftp_presentation.ppt

FTP Response format

Reply Description1yz

2yz3yz

4yz5yz

Positive preliminary reply.The action is being started but expect another reply before sending another cmd.Positive completion reply. A new cmd can be sent.Positive intermediate reply. The cmd has been accepted but another cmd must be sent.Transient negative completion reply. The requested action did not take place but can be sent laterPermanent negative completion reply. Cmd not accepted and should not be reissued.

x0zx1zx2z

x3z

x4zx5z

Syntax errorsInformationConnections. Replies referring to the control or data connections.Authentication and accounting UnspecifiedFilesystem status

Page 16: ftp_presentation.ppt

Example FTP Responses

• 120 Service will be ready shortly• 200 Command OK• 230 User login OK• 331 User name OK; password is needed• 421 Service not available• 503 Bad sequence of commands• 530 User not logged in

Page 17: ftp_presentation.ppt

Data Representation

• File Type• ASCII file

• Default format for transferring text files. Encoding done using NVT ASCII.

• Nonprint and TELNET• EBCDIC file

• File is transferred using EBCDIC encoding• Image file

• Default format for transferring binary files• Local file

• Data is transferred in logical bytes

Page 18: ftp_presentation.ppt

Data Representation (cont.)

• Structure• File Structure

• Default : stream of bytes

• Record Structure• Divided into records : only text files

• Page Structure• Divided into pages : each page has a page number and a page header

Page 19: ftp_presentation.ppt

Transmission Modes• Stream Mode

- Default mode• Block Mode

- Data is delivered to TCP in blocks• Compressed Mode

- Compression using Run-Length Encoding (RLE)

Page 20: ftp_presentation.ppt

Limitations of FTP

• No file tree transfer

• Limited file management

Page 21: ftp_presentation.ppt

Trivial FTP (TFTP)• Used only to read and write files

from/to a remote server– Cannot list directories

• Useful for bootstrapping diskless systems– Workstations– X terminals

• Simple and small:– 5 message formats– Runs on UDP– Designed to fit in ROM– Uses a “stop and wait” protocol– NO BUILT IN SECURITY FEATURES (login)

Page 22: ftp_presentation.ppt

FTP vs. TFTP• FTP provides (minimal) security through

login procedure• TFTP has NO login procedure• FTP Provides a reliable service through

its use of TCP• TFTP must handle it’s own

retransmissions since it uses UDP• FTP uses two connections• TFTP uses one connection (stop and wait)• FTP provides many commands• TFTP provides only 5 commands

Page 23: ftp_presentation.ppt

Ftp

•File Transfer Protocol (FTP)•Used to copy files between computers on the internet

•Local/Remote

•Ascii/Binary transfers

•Examples

Page 24: ftp_presentation.ppt

Ftp

•Overview

Topics

•Ascii/Binary transfers

•Examples

Local

Page 25: ftp_presentation.ppt

Ftp

•Overview

Topics

•Ascii/Binary transfers

•Examples

Remote

Page 26: ftp_presentation.ppt

Ftp

•Binary transfer is used when an exact copy is required.

–Word documents, executables …

•Ascii transfer is used for text based files.

–notepad, emails …

•Overview

Topics

•Examples

•Local/Remote

Page 27: ftp_presentation.ppt

Internet Explorer

Page 28: ftp_presentation.ppt

Internet Explorer

•Type in ftp://username@address•Hit return

Page 29: ftp_presentation.ppt

Internet Explorer

•You should be prompted for your password

Page 30: ftp_presentation.ppt

Internet Explorer

Page 31: ftp_presentation.ppt

Command Line

Page 32: ftp_presentation.ppt

Command Line

Page 33: ftp_presentation.ppt

Command Line

Page 34: ftp_presentation.ppt

Command Line

Changes transfer mode to binary

Page 35: ftp_presentation.ppt

Command Line

Changes transfer mode to ascii

Page 36: ftp_presentation.ppt

Command Line

•Transfers a file from your local machine to the connected machine:

- put file

Page 37: ftp_presentation.ppt

Command Line

•Changes to a new directory on your local machine

- lcd ..

Page 38: ftp_presentation.ppt

Command Line

•Changes to a new directory on the remote machine

Page 39: ftp_presentation.ppt

Command Line

•Typing help and then the topic will give you a brief description about the command

Page 40: ftp_presentation.ppt

File Transfer Protocol (FTP)with Microsoft Internet Explorer

• Start IE. Now, start an FTP Session by typing the address of the FTP site into the address bar of IE:– ftp://isat.project.cisat.jmu.edu

• You will be presented with the following dialog box.

Page 41: ftp_presentation.ppt

FTP with Microsoft IEType in the User Name: isatType in the Password: Your screen should look something like the one below

Page 42: ftp_presentation.ppt

IE-FTP (Continued)

• Hit Enter and you will be presented with:

Page 43: ftp_presentation.ppt

FTP Operations with IE• Double click on the 242 folder and then double click on your section folder.• The file operations you may perform are identical to file operations using

windows explorer. – You may use the menu on the menu bar or right mouse click (the most common

operations are easily accessible via right-mouse-clicks).– Drag-and-Drop operations also work the same as they do in windows explorer.

• Now– Create a new folder using your e-mail user name– Open up windows explorer and drag a file from your disk to the folder you just

created. The file will be copied from your disk to the FTP Site– After confirming it has been transferred, delete it from the FTP Site.– You now have completed the basic operation of FTP using Internet Explorer!

• Close Internet Explorer and you are automatically logged off of the FTP Server

Page 44: ftp_presentation.ppt

FTP using the WS_FTP Utility

Page 45: ftp_presentation.ppt

File Transfer Protocol (FTP)• Start an FTP Session• Fill in the Session Profile with your info• Profile Name:

– At Home: • ISAT 242

– In the Lab:• isat.project.cisat.jmu.edu

• Host Name:– isat.project.cisat.jmu.edu

• Host Type • Automatic detect

• User ID• isat

• Password• Leave it blank

Page 46: ftp_presentation.ppt

FTP - Login

• YOU WILL BE PROMTED TO ENTER A PASSWORD.

• If all went well, you are logged into the server and taken to the Opening Screen shown on the right!

• Carefully examine the screen.

Page 47: ftp_presentation.ppt

FTP - Screen Description• The left half of the main window is the

local information. The right half of the main window is the remote information. In each half of the main window there are two list boxes. The upper box is a list of directories while the lower half is a list of files. Just to the right of the two listboxes are a column of buttons. These are (from top to bottom):

– ChgDir– MkDir– RmDir– File Mask– View– Exec– Rename– Delete

• Below the listboxes, there are two status lines. You can double click in this area to expand this listing.

Page 48: ftp_presentation.ppt

FTP - Managing Files• MkDir Button• This is used to create a directory if

possible. You are prompted for a directory name and must supply a name that is valid for the current system. Not all systems allow you to make and delete directories remotely so a failure here does not indicate a failure in this program.

• Rename Button• Used to rename a file if possible. Enter

the new name for the item and press Rename or press Cancel to leave the item intact.

• Delete Button• Used to delete a file if possible. Press

YES to delete the item or NO to cancel. Not all systems allow you to delete files remotely so a failure here does not indicate a failure in this program.

Page 49: ftp_presentation.ppt

FTP - Remote Directory Creation• Make sure the window for the

remote server is active by clicking anywhere in the right window directory area

• Click the MkDir button• When prompted, enter your

user name for the directory name

• Click OK• You should see the directory

you created listed in the tree structure on the remote system

• Files for this course will be stored in your user directory.

• Now you are ready to transfer files to your directory!

Page 50: ftp_presentation.ppt

FTP - Transferring Files• Below the listboxes, there are two status

lines. You can double click in this area to expand this listing.

• Click the file that you want to select and press the desired transfer direction button: ( --- > from local computer to server) ( < -- from server to local computer)

• Transferring Multiple Files• To transfer multiple files,

use the CTRL keys when selecting filenames. (this is a standard windows method).

• 1. Click the first file that you want to select.

• 2 Press and hold down CTRL while you click each file.

• To cancel a selection• Press and hold down

CTRL while you click the selected file.• After selecting the desired files, press the

desired transfer direction button.

Page 51: ftp_presentation.ppt

FTP - Closing the Connection

• After you have transferred your files, close the connection by clicking the close button at the bottom-left corner of the screen

• Click the Exit button on the bottom-right corner of the screen to exit the FTP program

• NOTE: You are NOT permitted to give the password to anyone!

• Login sessions usually are monitored. You should NOT access any folder/files except your own or public ones !

Page 52: ftp_presentation.ppt

QUESTIONS???