
Pure-ftpd virtual users
October 31, 2013Long ago I attempted to setup my first FTP daemon on linux. One point that constantly caused me issues was how to setup users.
The basic setup I wanted was for an FTP user to be able to login, upload some files and the web server to serve them. When I was first looking at this I was thinking in terms of real users. This issue with this was that the real user would have real file permissions. Thus, if I had multiple users, there would be conflict, files wouldn’t be able to be moved/deleted. Additionally, there are security considerations. New users means new ssh login accounts etc.
When I revisited this issue recently I discovered that my FTP daemon actually supports virtual users. These users could then be mapped onto one local user account, thus solving the problem of conflicting permissions.
To perform this magic, I did the following:
- Make sure it’s installed. I’m using OpenSuse where it is one of the defaults.
- Create/Choose a user you want the virtual user to map to
- Go to /etc/pure-ftpd and edit pure-ftpd.conf
- Find this line and make sure it’s uncommented:
# PureDB user database (see README.Virtual-Users) PureDB /etc/pure-ftpd/pureftpd.pdb
- Use the pure-pw useradd function (reference below) to add your user
- Issue the pure-pw mkdb command to remake the database
- Enjoy the awesome
More information can be found at:
http://www.pureftpd.org/project/pure-ftpd
And information in particular about Virtual Users can be found at:
http://download.pureftpd.org/pure-ftpd/doc/README.Virtual-Users