Table of Contents

Overview and history

FTP (File Transfer Protocol) is a standard protocoll used to transfer data (binary and ascii) from one computer to another over the Internet or local area network (LAN). The first standard covering ftp was RFC 114 which has been published in April 1971. This was even before the two protocols TCP and IP existed. The given standard already defined the basic commands of the protocol and the behaviour when interacting with devices.

Connection related background

FTP is set up to work as a server-client application based on a reliable connection-oriented transport layer (OSI layer 4). By default the ftp protocol uses the TCP/IP port 21 but it is possible to use an arbitrary one if needed.

Some aspects concerning security and other disadvantages

Due to the fact of the early development and the main focus on an stable and easy protocol there are several riscs and disadvanteges in using plain ftp. A short list of disadvanteges:

Besides these inconveniences there also exists a few security related problems:

Using ftp with your FESTO SBOx-smartcamera

Preparing the FESTO SBOx-smartcamera

Before working with ftp make sure the ftp-daemon is started on the camera. To do this establish a telnet-session and dump out the current list of processes running on the camera whith help of the command ps:

/ $ ps
  PID  Uid        VSZ Stat Command
    1 root       1964 S   init
    2 root            SWN [ksoftirqd/0]
    3 root            SW< [events/0]
    4 root            SW< [kblockd/0]
    5 root            SW< [khelper]
    6 root            SW  [pdflush]
    7 root            SW  [pdflush]
    9 root            SW< [aio/0]
    8 root            SW  [kswapd0]
   10 root            SW  [mtdblockd]
   40 root       1964 S   syslogd -s 100 -m 0
   44 root       1972 S   telnetd -l /bin/login
   47 root            SWN [jffs2_gcd_mtd5]
   50 root            SWN [jffs2_gcd_mtd6]
   53 root       1976 S   -ash
   57 root       1984 S   -ash
   65 root       1652 S   /sbin/vsftpd
   62 root       1968 R   ps
/ $

Make sure that there is one line containing the expression /sbin/vsftpd. In this case you can go on using ftp. Otherwise you will first need to start the ftp-daemon with the command startftp. You can afterwards check the result with the command ps (see above).

/ $ startftp
/ $ ps
  PID  Uid        VSZ Stat Command
    1 root       1964 S   init
    .
    .
   57 root       1984 S   -ash
   65 root       1652 S   /sbin/vsftpd
   66 root       1968 R   ps
/ $

Setting up the connection

Establish a ftp-session (both Linux and Microsoft Windows®) by starting ftp to the remote device with the IP-address 192.168.2.10:

ftp 192.168.2.10

or

ftp
ftp> open
to: 192.168.2.10

After filling in the necessary authentication information (username root and valid password) you will be prompted and get full access to
the system:

ftp>

Short list of useful commands

Changing directories

change local directory

This is done with the command lcd (local cd) and the desired path (e.g. for windows):

lcd c:\temp

change remote directory

To change the remote directory on the FESTO SBOx-smartcamera just type in the command cd followed by the desired path (in this case let us
jump into the root-directory ffx):

cd /ffx

Display the content of the remote directory

To display the content of the current adjusted remote directory use the command ls or ls -la. The difference is the amount of details displayed in the listing:

ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
X11
bin
doc
etc
ipkg
lib
rcS
226 Directory send OK.
FTP: 36 Bytes received in 0,00seconds 36,00KB/s
ftp>

respectively ftp> ls -la

200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxr-xr-x    9 0        0               0 Jan 01 02:11 .
drwxr-xr-x   20 0        0            1024 Oct 12  2007 ..
drwxr-xr-x    7 0        0               0 Jan 01 02:11 X11
drwxr-xr-x    2 0        0               0 Jan 01 02:11 bin
drwxr-xr-x    2 1002     100             0 Oct 12  2007 doc
drwxr-xr-x    2 1002     100             0 Jan 01 02:12 etc
drwxr-xr-x    4 0        0               0 Jan 01 02:11 ipkg
drwxr-xr-x    2 0        0               0 Jan 01 01:03 lib
-rwxr-xr-x    1 1002     100           298 Feb 22  2007 rcS
226 Directory send OK.
FTP: 547 Bytes received in 0,01seconds 109,40KB/s
ftp>

Transfer a file from the host to the FESTO SBOx-smartcamera

This is done with the command put source-file destination-file (e.g.):

put onthehost.txt tofesto.txt

Transfer a file from the FESTO SBOx-smartcamera to the host

To retrieve a file back to the host you can use the command get source-file destination-file (e.g.):

get fromfesto.txt tothehost.txt

Alternative ftp-client programs with graphical interface

For those who are interested in interacting via GUI (Graphical User Interface) here is a short list of commonly used applications: