Howto install pureftpd on a debian machine

Posted by remofritzsche on Thu 6 Apr 2006 at 08:17

The target of this tutorial is to have a successful installation of the ftp-daemon pureftpd working with virtual user accounts. You should already know about installing pureftpd.

If you don't have it installed already just run:

# apt-get install pure-ftpd-common pure-ftpd

First of all, create a new system group for pureftpd:

# groupadd ftpgroup

As the second step you may add a user for it and give him no permission to a home directory or any shell:

# useradd -g ftpgroup -d /dev/null -s /etc ftpuser

Now lets create our first FTP user. For this example the user "remo":

# pure-pw useradd remo -u ftpuser -g ftpgroup -d /home/pubftp/remo -N 10

I gave him a limit of 10 MB disk space with the option "-N 10". Now you have to enter remo's new password twice.

By default your users will be saved in /etc/pureftpd.passwd, but first we have to update the pureftpd-Database:

# pure-pw mkdb

The "Database" here is simply a binary file. But it is ordered and has an index for quick access. To get some userdetails, enter:

pure-pw list

to get a complete list of all pureftpd users.

If you want to show information about a specific user: # pure-pw show remo

This will show you detailled information about the user "remo".

What does the line "Directory: /home/pubftp/helmut/./" specificaly the trailing ./ mean? Its simply the chroot for the user, that means he can't go "above" his directory.

If you forgot the password for a user, you can reset it as follows:

# pure-pw passwd remo

But please don't forget to update your database after you've done that:

# pure-pw mkdb

To test the server, first start it:

# /usr/sbin/pure-ftpd -S 127.0.0.1,21 -c 30 -C 1 -l puredb:/etc/pureftpd.pdb -x -E -j -R 

Now you should be able to connect via any FTP client

Share/Save/Bookmark


Posted by remofritzsche (217.71.xx.xx) on Thu 6 Apr 2006 at 10:02
[ Send Message | View Weblogs ]
If you want to set up your pureFTPd with MySQL usermanagement take a look here.

-
A programmer is just a tool which converts coca cola into code.

[ Parent | Reply to this comment ]

Posted by kmlhk79 (61.10.xx.xx) on Thu 6 Apr 2006 at 16:17
[ Send Message ]
Ha !!! , some important security things were missing .

How to prevent plain text password flow in the interent? (i.e. Via SSL )

How to enable SSL on pureftpd ? (pureftpd said it was supported.)

Normal FTP client does not support SSL , Any Debian FTP cleint can work on SSL to connect to pureftpd ?

Anyone can help on this ?

[ Parent | Reply to this comment ]

Posted by Anonymous (217.162.xx.xx) on Thu 6 Apr 2006 at 17:57
Mhh...sure you are right. I think I can post a update for that...maybie the next few days.

Greez
Remo

[ Parent | Reply to this comment ]

Posted by Anonymous (213.164.xx.xx) on Mon 10 Apr 2006 at 14:56
stunnel is one solution.

[ Parent | Reply to this comment ]

Posted by pymaunier (62.4.xx.xx) on Mon 10 Apr 2006 at 14:45
[ Send Message ]
For a better configuration than specifying all options on the command line, you should use the pure-ftpd-wrapper

for more informations :
man pure-ftpd-wrapper

[ Parent | Reply to this comment ]

Posted by Anonymous (61.145.xx.xx) on Sat 23 Feb 2008 at 06:09
first, thanks for the install guide, everything went through just fine. one correction, now days, it seems that apt-get is replaced by aptitude, so it will be aptitude install xxxxxx right now what i am trying to do is link linux user, ftp user, and mysql user together. might be a waste of time ----- life is boring, i am a proud user of adult toys, LoL

[ Parent | Reply to this comment ]

Posted by Anonymous (68.144.xx.xx) on Mon 19 Jan 2009 at 20:38
Isint it ILLEGAL to have adult links on a site like this where minors are?

[ Parent | Reply to this comment ]

Posted by remofritzsche (217.71.xx.xx) on Mon 10 Apr 2006 at 14:54
[ Send Message | View Weblogs ]
If there are interests I can write a tutorial about pureFTPd in combination with MySQL too..

-
A programmer is just a tool which converts coca cola into code.

[ Parent | Reply to this comment ]

Posted by Anonymous (65.84.xx.xx) on Mon 10 Apr 2006 at 20:00
what about adding that virtual user to multiple groups?

[ Parent | Reply to this comment ]

Posted by jooray (194.149.xx.xx) on Wed 12 Apr 2006 at 11:40
[ Send Message ]
Someone wanted to know how to get SSL working.

cd /etc/ssl/private
make-ssl-cert /usr/share/ssl-cert/ssleay.cnf pure-ftpd.pem

and enable ssl using pure-ftpd wrapper


I would point out one particular feature, I'm a long-time user of proftpd, but I found something in pure-ftpd, that is unique to this daemon. It's the virtual chroot feature. When you log in, you can
see only home directory, but symlinks outside chroot work. While not very good security feature, you
can limit your users to home directory and allow them to work on shared folders while avoiding them
browsing through your whole system.

You need to recompile the package for this to work however, it's as simple as:

apt-get build-dep pure-ftpd
apt-get source pure-ftpd
change in debian/rules:
optflags=--with-everything --with-pam --with-privsep --with-tls --with-virtualchroot

and then recompile using ./debian/rules binary (optionally using fakeroot or dpkg-build-package, as
you are used to).

What I don't like is the lack of per-directory configuration (like changing umask on per
directory basis), in this area, proftpd is really much better.

[ Parent | Reply to this comment ]

Posted by nigel_horne (212.159.xx.xx) on Fri 6 Jul 2007 at 11:12
[ Send Message ]
Which pacakage contains make-ssl-cert?

[ Parent | Reply to this comment ]

Posted by Anonymous (195.178.xx.xx) on Tue 11 Mar 2008 at 16:16
$ dpkg -S make-ssl-cert
ssl-cert: /usr/sbin/make-ssl-cert
ssl-cert: /usr/share/man/man8/make-ssl-cert.8.gz

[ Parent | Reply to this comment ]

Posted by Anonymous (85.61.xx.xx) on Fri 5 May 2006 at 22:47
If you get following error

421 Service not available, remote server has closed connection
Login failed.
No control connection for command: Success


while trying to login, check if you are not as stupid as i was...

/usr/sbin/pure-ftpd ... -l puredb:/etc/pureftpd.pdb ...

If you want to use puredb you just created you have to actaully refer to it. puredb on my system resided in a file /etc/pure-ftpd/pureftpd.pdb and as long as the server does not print out any warning that the file passed does not exist... it took me more than half an hour to figure it out.

[ Parent | Reply to this comment ]

Posted by ultimatedbz (70.49.xx.xx) on Thu 11 May 2006 at 22:37
[ Send Message ]
Hey
when a user i added using this command:

pure-pw useradd USERNAME -u ftpuser -g ftpgroup -d /var/www/users/USERNAME -N 200

And when the USERNAME is trying to upload a file the following error occurs:

Connecting FTP data socket mydomain.com...
553-Can't open that file: Permission denied
553 Rename/move failure: No such file or directory
ERROR:> Access denied.
Please help...

[ Parent | Reply to this comment ]

Posted by Anonymous (213.112.xx.xx) on Fri 1 Sep 2006 at 07:44
If i run a standalone server.
how do I change so the pure-ftpd starts up wit following setup
/usr/sbin/pure-ftpd -S 127.0.0.1,21 -c 30 -C 1 -l puredb:/etc/pureftpd.pdb -x -E -j -R instead for the normal.

[ Parent | Reply to this comment ]

Posted by famir (192.115.xx.xx) on Fri 1 Sep 2006 at 08:10
[ Send Message ]
Hi,
first of all thank you
i did it all and its works till ...
i dont knew what i did wronge ? please read and help !

debdeb:/etc/pure-ftpd/conf# /usr/sbin/pure-ftpd -S 127.0.0.1,21 -c 30 -C 1 -l puredb:/etc/pureftpd.pdb -x -E -j -R
-bash: /usr/sbin/pure-ftpd: No such file or directory
debdeb:/etc/pure-ftpd/conf# /usr/sbin/pure-ftpd -S 127.0.0.1,21 -c 30 -C 1 -l puredb:/etc/pureftpd.pdb -x -E -j -R
-bash: /usr/sbin/pure-ftpd: No such file or directory
debdeb:/etc/pure-ftpd/conf# cd /usr/sbin/pure-ftpd
-bash: cd: /usr/sbin/pure-ftpd: No such file or directory
debdeb:/etc/pure-ftpd/conf# cd /usr/sbin/
debdeb:/usr/sbin# cd pure-ftpd
-bash: cd: pure-ftpd: No such file or directory
debdeb:/usr/sbin# pure-ftpd -S 127.0.0.1,21 -c 30 -C 1 -l puredb:/etc/pureftpd.pdb -x -E -j -R
-bash: pure-ftpd: command not found


[ Parent | Reply to this comment ]

Posted by Anonymous (70.240.xx.xx) on Wed 7 Mar 2007 at 02:03
I get the same error, command not found. Its not in the /usr/sbin either for my Debian OS.

[ Parent | Reply to this comment ]

Posted by Anonymous (80.46.xx.xx) on Tue 12 Aug 2008 at 16:49
try executing your command with ./usr/sbin/pure-ftpd
its just that your user is not allowed to execute that file.

[ Parent | Reply to this comment ]

Posted by Anonymous (60.52.xx.xx) on Mon 7 May 2007 at 19:04
if using the standard installation and running standalone or inetd, you will need to create a link to /etc/pure-ftpd/conf/PureDB in /etc/pure-ftpd/auth to enable the PureDB database

[ Parent | Reply to this comment ]

Posted by Anonymous (213.10.xx.xx) on Thu 28 Feb 2008 at 12:56
About Open SSL/TLS support on pure-ftpd: Read the doc section shipped with the package, README.TLS ;)

[ Parent | Reply to this comment ]

Posted by Anonymous (81.241.xx.xx) on Thu 27 Mar 2008 at 10:15
If you want to use this authentication technique when compiling from source be sure to add puredb when running configure.
e.g.
# ./configure --with-puredb

[ Parent | Reply to this comment ]

Posted by ghadamyari (217.219.xx.xx) on Mon 4 Jan 2010 at 05:54
[ Send Message ]
I have tested it on Debian Lenny 5.
The Pure-FTPd Server does not start at all.
Could you please check it? I have checked this article on 3 different Systems and Pure-FTPd does not starts while it returns no errors!

[ Parent | Reply to this comment ]

Posted by sv0 (93.180.xx.xx) on Fri 5 Mar 2010 at 11:29
[ Send Message ]
Check your /etc/default/pure-ftpd-common
By default STANDALONE_OR_INETD is set to inetd.
Change it to
STANDALONE_OR_INETD=standalone
and start pure-ftpd:
$ sudo /etc/init.d/pure-ftpd start

[ Parent | Reply to this comment ]

Posted by Anonymous (92.60.xx.xx) on Mon 15 Feb 2010 at 13:04
Hi, I instaled Pureftpd on Debian 5.0, with chrooted virtual users. I can connect corectly, I see my files but I can't there is line like "export STANDADLONE_OR_INETD=inetd" , should I change it to "export STANDADLONE_OR_INETD=standalone" ??. When I add new like: pure-pw useradd remo -u ftpuser -d /home/pubftp/remo , directory /home/pubftp/remo is not created :(
What I doing wrong? Any idea?

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search