create your own

PureFTP - Simple FTP server

75
rate or flag this page

By suhaime


Installing 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/pure­ftpd­.0.21.tar.bz2

4. Untar the file downloaded ◦

tar xjvf pure­ftpd­1.0.21.tar.bz2 ◦

5. Change in the directory created by the file. ◦

cd pure­ftpd­1.0.21 ◦

6. Compile the software with the configuration options below. ◦ ◦

./configure ­­--with­puredb --­with­throttling --­with­ratios ­­--with­ftpwho --­without­banner

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/pure­ftpd ­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:

pure­pw useradd <username> ­-u ftpuser ­-g ftpgroup ­-d /jail/home/<foldername> ­-m

For client:

pure­pw useradd <username> ­-u ftpclient ­-g ftpgroup ­-d /jail/home/<foldername> ­-m

Example: abc (administrator user) xyz (client user)

pure­pw useradd abc ­-u ftpuser ­-g ftpgroup ­-d /jail/home/abc ­-m

Enter the password when prompted by the system.

pure­pw 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: pure­pw list

b) user deletion: pure­pw userdel <username>

c) user password management: pure­pw passwd <username>

Hope this will help to set-up your own FTP server. Good Luck. 

Print   —   Rate it:  up  down  flag this hub

Comments

RSS for comments on this Hub

No comments yet.

Submit a Comment

Members and Guests

Sign in or sign up and post using a hubpages account.


optional


  • No HTML is allowed in comments, but URLs will be hyperlinked
  • Comments are not for promoting your hubs or other sites

working