Categories
Computers Linux

Install Pure-ftpd

pure-ftpd icon

It should be very simple to set up an FTP server on a Linux server but for some reason I always seem to have an issue with it. The first question is which daemon to install when there are so many. The main three contenders seem to be pure-ftpd, proftpd and vsftpd but even choosing between them can be daunting.

Many (if not all) FTP servers seem to have been written with the intent to either providing FTP access for people with shell accounts on the FTP server or for anonymous users. I have no interest in anonymous access and the only one with local account that need file access is myself and I much prefer to use scp via Cyberduck instead. So my requirement for a pure virtual FTP server is usually not mainstream and I invariably find myself lost in all configuration descriptions.

Here is a simple step for setting up pure-ftpd on a Debian system and add an account:

  • Install the server [apt-get install pure-ftpd]
  • Create an FTP group [groupadd ftp]
  • Create an FTP user [useradd -g ftp -d /dev/null -s /etc ftp]
  • Create a folder to hold the FTP data [mkdir /var/ftp]
  • Change owner on the folder [chown ftp:ftp /var/ftp]
  • Add a pure-ftpd user [pure-pw useradd testuser -u ftp -d /var/ftp -N 300]
  • Save the changes [pure-pw mkdb]
  • Run the server [/usr/sbin/pure-ftpd -j -lpuredb:/etc/pure-ftpd/pureftpd.pdb &]

To start the server automatically, use xinetd and add the following to /etc/xinetd.d/ftp:

service ftp
{
socket_type = stream
server = /usr/sbin/pure-ftpd
server_args = -j -lpuredb:/etc/pure-ftpd/pureftpd.pdb
protocol = tcp
user = root
wait = no
disable = no
}

Then restart xinetd (/etc/init.d/xinetd restart).

2 replies on “Install Pure-ftpd”

Hi,

can you easily add several no-shell users? I use ProFTPd at home because it was the only one I found to work on FreeBSD several years ago that allowed you to create several virtual users with their own passwords.

/Kalle

Sure,just issue a couple more “pure-pw useradd…” commands. The account used by the FTP server to read/write data can be different between different FTP users, as can the FTP folder. The real user must of course have permission to read/write files in the folder. The “-N 300” part at the end is the quota by the way.

When all users have been added then save the changes by typing “pure-pw mkdb”.

Comments are closed.

css.php