File Transfer Protocol (FTP) Servers on the PBX

When transferring files over the Internet, there are two ways: HTTP and FTP. HTTP uses web browsers talking to a web server to transfer files. The other way is to use the FTP (File Transfer Protocol) protocol that was developed specifically for transferring files.

FTP works on a client/server basis, the device that is sharing the files is the server and the device that is downloading the files is the client. Downloading means transferring files from the server to the client. Uploading means transferring files from the client to the server.

FTP uses two well known ports for transferring files: port 21 and port 20. Port 21 is the port that is used to manage the file transfer and is the port that is used by the client to talk to the server. Port 20 is used for the actual transfer of the files. This means that any firewalls between the client and server must have ports 20 and 21 open for communication.

Command Line FTP

FTP is part of the TCP/IP suite of protocols and should be installed on any client running the TCP/IP protocol. Windows will often have the FTP client disabled so you may have to enable it.

To run an FTP session from the command line, you give the command "ftp " at the command line prompt:

These are examples of a failed login attempt and a successful login into an FTP server.

In the above screen capture, a login attempt was made to a PC that did not have a FTP daemon running. The connection was refused. The second login is a successful login using the FTP client's username and password. The password is not displayed.

FTP commands

There are quite a few FTP commands but only a few used when in the command line. The first command should be an automatic response by the user: binary. This sets the transfer mode to 8 bit. Most ftp command line clients default to 8 bit mode as this client indicates. The alternative to binary mode is ascii or 7 bit mode which was used when transfer rates were slow (1200 bps) and used to transfer text files. If you transfer an 8 bit file like an image or application using 7 bit mode, the file will be corrupted. There is no need to use 7 bit mode anymore.

The basic commands are case sensitive and follow standard unix convention except for the "dir" command which is the same as MSDOS and equivalent to the unix "ls" command for displaying the contents of a directory.

To download a file, you "get" the file, to upload a file you "put" the file. In both cases, the file must be in the current directory either the server side for "get" or the client's current directory for "put". The filename is case sensitive so make sure you match the upper and lower letters. For multiple file downloads, you can use "mput" and "mget" but now it becomes awkward and there are many better ways using a GUI to do this which will be discussed further down.

Why use FTP command line?

The FTP command line lets you see the actual conversation between the client and server. If you use a GUI and FTP fails, it is not really obvious as to why it failed. It could be a connection problem, a server problem, the FTP GUI configuration, wrong username or a bad password. Using the FTP command line gives you a good indication of where the connection failed and is the first step in troubleshooting FTP problems.

FTP Graphical User Interfaces (GUIs)

There are many GUIs available for FTP, some are free and some you have to pay for. One that I find particularly useful and is free is FilleZilla. It is available for the MacOS, Windows and Linux and comes as both a FTP server and client.

Filezilla is a free FTP client and server

Filezilla follows the classic FTP client GUI structure with the left side being the FTP client and the right side being the FTP server that is connected to. You transfer files between the two windows.

WinSCP is a free FTP client for the Windows platform

WinSCP is a free FTP client for the Windows platform and can be configured to look like a classic FTP client like Filezilla or as a Windows Explorer window and show the FTP server as a folder on the desktop. You drag and drop files to transfer files.

Most FTP clients can be configured for secure file transfers using the sFTP or SCP protocols. The authentication and transfers are encrypted.

Secure Copy (SCP)

Secure Copy (SCP) is a command line utility designed to transfer files across the network. It uses port 22 instead of 21 for communications. Most FTP client GUIs incorporate the SCP command as an option for secure transfers of files. For all intensive purposes, the GUI appears the same as a regular FTP session but the transfer is encrypted. It provides an encrypted transfer using the SSH protocol.

Secure FTP (sFTP)

Secure FTP (sFTP) is not FTP run over SSH, but rather a new protocol designed from the ground up by the IETF SECSH working group. SFTP provides file access, file transfer, and file management. It was designed by the Internet Engineering Task Force (IETF) as an extension of the Secure Shell protocol (SSH) version 2.0 to provide secure file transfer capability. It provides a secure file transfer over Transport Layer Security (TLS) and transfer of management information in VPN applications. It uses SSH to provide the encryption and key information.

If this page has helped you, please consider donating $1.00 to support the cost of hosting this site, thanks.

Return to

TelecomWorld 101

Copyright July 2013 Eugene Blanchard