PureFTP - Simple FTP server
75Installing an FTP server
An FTP server is a highly useful method of trnasferring files along the Internet. With the right configuration, an FTP server can be used as a method to transfer large files over the Internet. The use of e-mails to send out large files is impractical and will cause unneccessary strain on the network. Below are the guide to setting up a personal FTP server based on Linux using the Pure-FTPd software as its FTP server
Installation
1. The installation of Pure-FTPd will be from the source. Users will have to compile the software in order to be able to use it.
2. Grab the latest version of Pure-FTPd software from http://download.pureftpd.org/pub/pure-ftpd/ releases/pure-ftpd-1.0.21.tar.bz2
3. Open the terminal (Konsole, GNOME Terminal) to grab the file using wget ◦ wget http://download.pureftpd.org/pub/pure ftpd/releases/pureftpd.0.21.tar.bz2 ◦
4. Untar the file downloaded ◦
tar xjvf pureftpd1.0.21.tar.bz2 ◦
5. Change in the directory created by the file. ◦
cd pureftpd1.0.21 ◦
6. Compile the software with the configuration options below. ◦ ◦
./configure --withpuredb --withthrottling --withratios --withftpwho --withoutbanner
The configure switches are for the following
--with-puredb: support virtual users, ie. a local users database, independent of your system accounts
--with-throttling: support bandwidth throttling
--with-ratios: support upload/download ratios
--with-ftpwho: support for the 'pure-ftpwho' command. Enabling this feature needs some extra memory. Better use it when the server is run in standalone mode. It can be way slower in inetd mode
--without-banner: don't display the initial banner
Continue compiling with the following command
make
make check
make install
7. Pure-FTPd supports the use of Virtual Users. This is especially good when dealing with many users for the FTP services without the creation of local user at the server.
mkdir /jail
cd /jail
mkdir home
groupadd ftpgroup useradd -g ftpgroup -d /jail/home ftpuser
useradd -g ftpgroup -d /jail/home ftpclient
chown ftpuser:ftpgroup /jail/home -R
chmod 744 /jail/home -R
/jail/home – is the ftp folder. All files will be uploaded into this directory
ftpgroup – is the group for the ftpuser and ftpclient
ftpuser – is the user that able to download/upload files (administrator)
ftpclient – is the user that only able to download uploaded files (client)
chown command is enable the ownership of the directory to ftpuser and ftpgroup
chmod command (744) is for the folder to writable by only the owner (ftpuser) and read- only by others (ftpclient)
8. Start the service either using inetd or start directly from terminal
/usr/local/sbin/pureftpd j --createhomedir lpuredb:/etc/pureftpd.pdb &
This will start the Pure-FTPd services with virtual users enabled.
Basic Operations
Adding a user
1. Users for the FTP server are virtual users. It means that the users' details are kept in a separate database without creating local users.
2. There are two types of users:
a) ftpuser - administrator – upload, download, create folders, delete files/folders, rename files/folders
b) ftpclient - client – download files only
3. The command to add user are as follows:
For administrator:
purepw useradd <username> -u ftpuser -g ftpgroup -d /jail/home/<foldername> -m
For client:
purepw useradd <username> -u ftpclient -g ftpgroup -d /jail/home/<foldername> -m
Example: abc (administrator user) xyz (client user)
purepw useradd abc -u ftpuser -g ftpgroup -d /jail/home/abc -m
Enter the password when prompted by the system.
purepw useradd xyz -u ftpclient -g ftpgroup -d /jail/home/abc -m
Enter the password when prompted by the system.
4. The directory for the intended user will be created automatically once the user logged in to the system. Other user related operations:
a) user listing: purepw list
b) user deletion: purepw userdel <username>
c) user password management: purepw passwd <username>
Hope this will help to set-up your own FTP server. Good Luck.
PrintShare it! — Rate it: up down flag this hub









