40.1. Introduction to FTP and ProFTPD

FTP stands for File Transfer Protocol, and along with telnet and SMTP is one of the oldest protocols still in common use on the Internet. FTP is designed to allow client programs to read, write, and delete files on a remote server, regardless of the operating system that the server is running. It is essentially a file sharing protocol, but unlike the more common NFS and SMB protocols, it is better suited to use over a slow or high-latency network.

Typically, FTP is used to transfer files from one system to another. Sometimes those files are Linux distribution CD images or RPM packages, downloaded by various client hosts on the Internet from a large server system that hosts them for everyone to access. Other times, the files are pages for a website, uploaded by an FTP client run by the site's owner to a system that runs both the web server and an FTP server.

Even though the FTP protocol has been mostly replaced by HTTP as a method of downloading files, it still has many advantages. The biggest is the clients' ability to upload files to the server, assuming that is has been configured to allow them. Another is a semi-standard directory listing format, which clients can use to fetch a list of files in a directory from the server.

When an FTP client connects to a server, it must first authenticate itself before any file transfers can take place. Often, clients will log in as the special anonymous user, which requires no password and is usually configured to be only able to download files. On UNIX systems, most FTP servers allow any local user to log in with the same username and password that he would use for telnet or SSH, and give his client access to the same files with the same permissions.

Another unique feature of the FTP protocol is its support for translating files between the data format used on the client and that used on the server. The most common use of this is the conversion of text files between the UNIX, Windows, and MacOS formats, each of which uses different characters to represent the end of a line. This feature can be disabled for the transfer of binary files such as images, executables, and ISOs, as it corrupts non-text data.

Many different FTP client programs exist, from the basic UNIX ftp command to browsers like Internet Explorer and Mozilla. Every modern operating system has at least one, and almost all include a client of some kind as standard. FTP servers are also plentiful, but this chapter focuses on only one—ProFTPD, which in my opinion is the most flexible server available for UNIX operating systems.

Even though all varieties of UNIX ship with an FTP server as standard, the supplied server is usually either very basic and lacking in features, or the more powerful WU-FTPd. The latter is the most common FTP server in use today, and although it has many configurable options, it is not as capable as ProFTPD when it comes to virtual hosting, directory restrictions, and locking users into their home directories. It is covered in Chapter 41, however, so if you already have WU-FTPd installed and don't want to bother switching, read that chapter instead.

ProFTPD generally uses a single configuration file, found at /etc/proftpd.conf. This file is made up of directives, each of which usually occupies a single line and has a name and value. Each directive sets a single configurable option, such as the name of a hidden file or the path to a welcome message. There are also special container directives for grouping other directives that apply only to a single virtual server or directory, and which span multiple lines.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.135.129