CMIT 265 FTPing Name:_______________________________ Use anonymous ftp to download a file from a Linux server. At the XP command prompt: [if CMD starts in ...\Student : cd "My Documents" ] [Say OK if the Windows Firewall pops up] ftp 192.168.0.197 Login as user 'anonymous', password can be anything or, traditionally, your email address, or nothing. 'pwd' says what the current directory is:_______ 'ls' lists the files and folders in the current directory:________ Publicly available files are in the "pub" subdirectory. Typically with anonymous ftp you're limited in what parts of the system you can access and you can't upload files, only download. 'cd pub' to change to the pub directory. Do 'ls' again to see what happened: ______________________________ 'pwd' shows the present working directory (where you "are"): ____________ 'cd ..' takes you up one directory level to the parent directory What directory are you in now:______ 'cd pub' to change to the pub directory 'ls -l' to see what's there. what's the size of the zonealarm.exe: _____________________ What server port is this FTP session connected to:______ What ephemeral port is this FTP client session using:______ Download the asdf.txt file with the 'get' command: 'get asdf.txt' (SKIP: a problem can be that you don't have permission to create a file in the XP folder you're in, so quit ftp, cd My Documents, restart ftp). In XP open the downloaded file, what is its contents: ____________________________ ftp's online help: '?' lists the ftp commands. '? get' says what the get command does:______________________ '? put' says what the put command does:______________________ cd, ls, get, and put are the basic ftp commands. mget and mput allow multiple files to be downloaded/uploaded, e.g. 'mget *.txt' uses the * wildcard to match any characters, meaning download all files ending in .txt. Start to download the 100meg.txt file, what additional server port has been connected to:_____ This is the data port that ftp uses to transmit the data. Terminate the download with Ctrl-C. How much of the file was downloaded onto your system:_______ If all of it was downloaded, delete the file, start the download again, terminate it and How much of the file was downloaded onto your system:_______ Connect to the anonymous FTP server again. In another 'cmd' window telnet to that Linux server, login as 'cmit265' with the usual password. Doing the 'who' or 'w' command will not list the FTP login. Doing 'netstat -t' to see the TCP connections will show the established FTP connections. What is listed as your FTP connection's Foreign Address:_______________________ Logoff the ftp server (in the FTP cmd window): 'quit' In the telnet session, do 'netstat -t' to see your FTP is gone. Logoff the telnet by 'exit'. *************************** The ftp server also allows non-anonymous ftp, where you log in as a valid system user. We have a class account: 'cmit265' ftp to the 192.168.0.197 server and logon as user 'cmit265' and you'll have to give the correct password. With non-anonymous ftp you typically have as much file and folder access as you have when telneting/ssh but are limited to using ftp commands. What directory (folder) are you logged in to:__________ In the 'ls -l' output, a line that starts with a 'd' indicates a directory. What folders are in the home directory (i.e. the directory you're at when you login):_________________________________ Download the one file that's in the public_html folder. What is its contents: ____________________________ Download '100meg.txt' While it's downloading, you have a connection to FTP's data port 20 over which the data flows; port 21 is FTP's control port. This is active-mode FTP: the server initiates the connection to the client. Firewalls can block such external attempts to open a connection so passive-mode FTP does not use port 20 but rather a random port higher than 1024. What is the ephemeral port being used in this connection to the server's port 20:________ (the download is fast, so maybe you'll have to run it again to catch the data port). What are the status lines FTP reports after the download: ____________________________ Upload a small text file that has your name as its name (e.g. if your name is smith, create a small file on Windows named smith using whatever method you want to create the file). Upload it to the public_html folder. Upload with 'put yourfilename' Do 'ls -l' to see your file on the Linux server. What is the line with your file: ___________________________________________________________ Use a web browser and go to http://192.168.0.197/~cmit265 You should see a directory index of the files in public_html. What is the largest file's name:____________________ *************************** TFTP (Trivial File Transfer Protocol) uses UDP port 69. It's completely separate from FTP. There's no authentication (i.e. password), no cd'ing, no ls'ing. It's a non-interactive kind of ftp. You have to know the filename of what you need to download. Typically used for loading and booting an operating system into a diskless workstation or for downloading a new version of a router's operating system. 192.168.0.197 is also running a TFTP server (completely separate and no relation to the FTP server). XP has a TFTP client. From XP cmd: Use 'tftp' to download a file: tftp 192.168.0.197 GET bases.txt Looking in the downloaded file, what is the number next to Foster:_____ Doing 'tftp' by itself shows the possible usage of it. What is the purpose of the -i option:______________________________________ Using 'netstat -sp udp' before and after (re)running the above tftp command, how many UDP packets were sent and received by this transaction: ____ _______ Use tftp to download esim.exe and include the -i option, using 'netstat -sp udp' before and after downloading, how many UDP packets were sent and received by this transaction: _____ ______ Test that the download succeeded by running the esim.exe. If it doesn't run maybe the -i option wasn't included. What is the size of the downloaded esim.exe file:___________ [SKIP: Close any other networking application, start Task Manager's Networking, turn on Bytes received, Bytes sent, Unicasts received and Unicasts sent, Reset the stats, Download esim.exe and include the -i option, How many Bytes received, Bytes sent, Unicasts received and Unicasts sent ___________ _________ ___________ __________ END SKIP] ******************************************** Download the pscp.exe file from the class web site. This is a secure version of FTP that uses SSH to encrypt your password and the transferred file. Download it to My documents. Start a CMD. CD My documents UPLOAD: pscp my_file_to_upload username@192.168.0.197:folder/subfolder DOWNLOAD: pscp username@192.168.0.197:folder_path/filename . Use this instead of FTP. Copy and paste the Local Area Connection Support Details information (one copy copies all the lines) into a text file. Name the file with your name and IP address, upload it using pscp to cmit265's public_html folder.