OnWorks Linux and Windows Online WorkStations

Logo

Free Hosting Online for WorkStations

< Previous | Contents | Next >

ftp

One of the true “classic” programs, ftp gets it name from the protocol it uses, the File Transfer Protocol. FTP is used widely on the Internet for file downloads. Most, if not all, web browsers support it and you often see URIs starting with the protocol ftp://.

Before there were web browsers, there was the ftp program. ftp is used to communi- cate with FTP servers, machines that contain files that can be uploaded and downloaded over a network.

FTP (in its original form) is not secure, because it sends account names and passwords in cleartext. This means that they are not encrypted and anyone sniffing the network can see them. Because of this, almost all FTP done over the Internet is done by anonymous FTP servers. An anonymous server allows anyone to login using the login name “anonymous” and a meaningless password.

In the example below, we show a typical session with the ftp program downloading an Ubuntu iso image located in the /pub/cd_images/Ubuntu-16.04 directory of the anonymous FTP server fileserver:


[me@linuxbox ~]$ ftp fileserver

Connected to fileserver.localdomain.

[me@linuxbox ~]$ ftp fileserver

Connected to fileserver.localdomain.


220 (vsFTPd 2.0.1)

Name (fileserver:me): anonymous

331 Please specify the password. Password:

230 Login successful. Remote system type is UNIX.

Using binary mode to transfer files. ftp> cd pub/cd_images/Ubuntu-16.04

250 Directory successfully changed. ftp> ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

-rw-rw-r-- 1 500 500 733079552 Apr 25 03:53 ubuntu- 16.04-desktop-amd64.iso

226 Directory send OK. ftp> lcd Desktop

Local directory now /home/me/Desktop ftp> get ubuntu-16.04-desktop-amd64.iso

local: ubuntu-16.04-desktop-amd64.iso remote: ubuntu-16.04-desktop- amd64.iso

200 PORT command successful. Consider using PASV.

150 Opening BINARY mode data connection for ubuntu-16.04-desktop- amd64.iso (733079552 bytes).

226 File send OK.

733079552 bytes received in 68.56 secs (10441.5 kB/s) ftp> bye

220 (vsFTPd 2.0.1)

Name (fileserver:me): anonymous

331 Please specify the password. Password:

230 Login successful. Remote system type is UNIX.

Using binary mode to transfer files. ftp> cd pub/cd_images/Ubuntu-16.04

250 Directory successfully changed. ftp> ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

-rw-rw-r-- 1 500 500 733079552 Apr 25 03:53 ubuntu- 16.04-desktop-amd64.iso

226 Directory send OK. ftp> lcd Desktop

Local directory now /home/me/Desktop ftp> get ubuntu-16.04-desktop-amd64.iso

local: ubuntu-16.04-desktop-amd64.iso remote: ubuntu-16.04-desktop- amd64.iso

200 PORT command successful. Consider using PASV.

150 Opening BINARY mode data connection for ubuntu-16.04-desktop- amd64.iso (733079552 bytes).

226 File send OK.

733079552 bytes received in 68.56 secs (10441.5 kB/s) ftp> bye


Here is an explanation of the commands entered during this session:


Command Meaning

Command Meaning

ftp fileserver Invoke the ftp program and have it connect to the FTP server fileserver.


image

anonymous Login name. After the login prompt, a password prompt will appear. Some servers will accept a blank password, others will require a password in the form of an email address. In that case, try something like “[email protected]”.


image

cd pub/cd_images/Ubuntu-16.04 Change to the directory on the remote

system containing the desired file. Note that on most anonymous FTP servers, the files for public


image

Transporting Files Over A Network


image

downloading are found somewhere under the pub directory.


image

ls List the directory on the remote

system.


image

image

lcd Desktop Change the directory on the local system to ~/Desktop. In the example, the ftp program was invoked when the working directory was ~. This command changes the working directory to ~/Desktop.

get ubuntu-16.04-desktop- amd64.iso

Tell the remote system to transfer the file ubuntu-16.04-desktop- amd64.iso to the local system.

Since the working directory on the local system was changed to

~/Desktop, the file will be downloaded there.


image

bye Log off the remote server and end the

ftp program session. The commands

quit and exit may also be used.


image


Typing “help” at the “ftp>” prompt will display a list of the supported commands. Using ftp on a server where sufficient permissions have been granted, it is possible to perform many ordinary file management tasks. It’s clumsy, but it does work.


Top OS Cloud Computing at OnWorks: