This site is now 100% read-only, and retired.

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

 

 


Re: Howto install pureftpd on a debian machine
Posted by remofritzsche (217.71.xx.xx) on Thu 6 Apr 2006 at 10:02
[ 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 ]

Re: Howto install pureftpd on a debian machine
Posted by kmlhk79 (61.10.xx.xx) on Thu 6 Apr 2006 at 16:17
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
Posted by Anonymous (213.164.xx.xx) on Mon 10 Apr 2006 at 14:56
stunnel is one solution.

[ Parent ]

Re: Howto install pureftpd on a debian machine
Posted by pymaunier (62.4.xx.xx) on Mon 10 Apr 2006 at 14:45
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
Posted by remofritzsche (217.71.xx.xx) on Mon 10 Apr 2006 at 14:54
[ 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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
Posted by jooray (194.149.xx.xx) on Wed 12 Apr 2006 at 11:40
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 ]

Re: Howto install pureftpd on a debian machine
Posted by nigel_horne (212.159.xx.xx) on Fri 6 Jul 2007 at 11:12
Which pacakage contains make-ssl-cert?

[ Parent ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
Posted by ultimatedbz (70.49.xx.xx) on Thu 11 May 2006 at 22:37
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
Posted by famir (192.115.xx.xx) on Fri 1 Sep 2006 at 08:10
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
Posted by Anonymous (70.168.xx.xx) on Tue 9 Sep 2014 at 19:59
This comment saved my day!

[ Parent ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
Posted by ghadamyari (217.219.xx.xx) on Mon 4 Jan 2010 at 05:54
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 ]

Re: Howto install pureftpd on a debian machine
Posted by sv0 (93.180.xx.xx) on Fri 5 Mar 2010 at 11:29
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 ]

Re: Howto install pureftpd on a debian machine
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 ]

Re: Howto install pureftpd on a debian machine
Posted by Anonymous (87.181.xx.xx) on Sat 22 May 2010 at 00:13
Thanks for the concise explanation. The one under http://download.pureftpd.org/pub/pure-ftpd/doc/README was to talkative for me, since I didn't read down to the "STANDALONE INSTALLATION" part, and therefore missed the important part. Nonetheless I propose some further devotion to the last command in your tutorial. Since the switches/arguments there are quite important as I found out after reading the manpage of pure-ftpd. Snippets (...) from man, with my own short interpretations beforehand:

-S "Is needed, when server runs standalone. Accepts connections on this ip and port (usually 21)"
A service name (see /etc/services) can be used instead of a numeric port number.

-c "Maximum allowed connections"
Allow a maximum of clients to be connected. clients must be at least 1, and if you combine it with -p it will be forced down to half the number of ports specified by -p...

-C Limit the number of simultanous connections coming from the same IP address. This is yet another very effective way to prevent stupid denial of services and bandwidth starvation by a single user...

-l "Provides in this case a PureDB (could be mysql) Authentification-DB. This is already available after pureftpd installation (In my case under /etc/pure-ftpd/pureftpd.pdb"
Enable a new authentication method. It can be one of : -l unix For standard (/etc/passwd) authentication...

-x In normal operation mode, authenticated users can read/write files beginning with a dot ('.'). Anonymous users can't, for security reasons...

-E Only allow authenticated login. Anonymous users are prohibited.

-j If the home directory of an user doesn't exist, automatically create it. The newly created home directory belongs to the user, and permissions are set according to the current directory mask...

-R Disallow users (even non-anonymous ones) usage of the CHMOD command (enter man chmod in terminal if you don't understand)

So concluding from this I change this for home purposes:
-S 192.168.2.X,21 Where X is the last octet (?!?) of your machines ip adress.
Use ifconfig in a terminal, if you want to find out the ip of your interface.
Whats the purpose of an FTP-Server only accepting connections from the same machine, anyhow?
-c 2 Only allowed 2 users
removed -j Created directories beforehand
Changed "puredb:/etc/pureftpd.pdb" to "puredb:/etc/pure-ftpd/pureftpd.pdb"

I'm in no way an experienced linuxer or english native speaking. So excuse any errors.

So long and thanks for the fish.

[ Parent ]

Re: Howto install pureftpd on a debian machine
Posted by mlodyy (86.13.xx.xx) on Tue 12 Jul 2011 at 00:23
I HAVE SOME PROBLEM HELP !! entered into CT 110
root@pixelwor:/# apt-get install pure-ftpd-common pure-ftpd
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package pure-ftpd-common
E: Unable to locate package pure-ftpd

[ Parent ]

Re: Howto install pureftpd on a debian machine
Posted by Anonymous (175.143.xx.xx) on Wed 5 Oct 2011 at 13:48
how a client can transfer a file to the pure ftpd server.
either using wireless or wired?
can somebody help me.

[ Parent ]

Re: Howto install pureftpd on a debian machine
Posted by Anonymous (175.143.xx.xx) on Thu 6 Oct 2011 at 01:24
how to show that the ftp installation was successful. i means through browser?

[ Parent ]

Re: Howto install pureftpd on a debian machine
Posted by Anonymous (77.70.xx.xx) on Mon 12 Dec 2011 at 22:47

[ Parent ]

Re: Howto install pureftpd on a debian machine
Posted by Anonymous (69.62.xx.xx) on Mon 11 Feb 2013 at 21:11
# /usr/sbin/pure-ftpd -S 127.0.0.1,21 -c 30 -C 1 -l puredb:/etc/pureftpd.pdb -x -E -j -R
should be
# /usr/sbin/pure-ftpd -S 127.0.0.1,21 -c 30 -C 1 -l puredb:/etc/pure-ftpd/pureftpd.pdb -x -E -j -R

[ Parent ]