Guide for Installing Pure-FTPd and Creating Virtual Users
Hey Zappers,
Bored of managing files over WebUI and want some change? So, we have a good choice for a change.
We will show how you can install FTP Server on your VPS or Dedicated Machine using Pure-FTPd tool. We will also show you how you can create Virtual Users for FTP Service that can be accessed by you over FTP. Using Virtual Users makes sure that it doesn’t create any conflicts with Unix Users or can be said as Real Users. There are few prerequisites for performing entire tasks to achieve success.
Requirements
- Linux Server with Root
- SSH Commands Experience
Procedure
Installation and configuration for FTP Server using Pure-FTPd
- Login to root via SSH
- Create user and group without any privileges and no valid shell.
groupadd _pure-ftpd
useradd -g _pure-ftpd -d /var/empty -s /etc _pure-ftpdNote- Don’t Use this user and group anywhere for any purpose.
- Download Latest Pure-FTPd tar ball according to your CPU Architecture and Distribution
https://www.pureftpd.org/project/pure-ftpd/download
- Extract tar ball using
tar -xvf *.tar.gz
- Prepare source code for installation
./configure –with-everything
–with-everything flag will build a big server with almost all features turned on:
altlog, cookies, throttling, ratios, ftpwho, upload script, virtual users
(puredb), quotas, virtual hosts, directory aliases, external authentication,
Bonjour and privilege separation. - Install prepared binary from source
make install-strip
- Link Pure-FTPd to .conf file in /etc/
/usr/local/sbin/pure-ftpd /etc/pure-ftpd.conf
- We need to make slight configuration changes in pure-ftpd.conf file
nano /etc/pure-ftpd.conf
- Look for #UnixAuthentication and uncomment that line (remove the # symbol)
- Uncomment the PureDB line
- Uncomment the CreateHomeDir line
- Save and exit conf file
- Start FTP Server using
/usr/local/sbin/pure-ftpd &
‘&’ is mandatory, please don’t skip it
- FTP Server is ready and ready to role. Run following to test
ftp localhost
- We will configure to run FTP Server on boot, add the following line in /etc/rc.d/rc.local or /etc/rc.d/boot.local and don’t forget the ‘&’ sign. Then save and exit.
/usr/local/sbin/pure-ftpd &
Create Virtual User
- Login to root via SSH.
- Create user ftpuser and group ftpgroup
groupadd ftpgroup
useradd -g ftpgroup -d /dev/null -s /etc ftpuser - For creating FTP user we need to decide in which user and group it goes. We will create basezap FTP user and it will be added in user blogger and group also blogger. Enter Password for created user twice when asked after below command execution.
pure-pw useradd basezap -u blogger -g blogger -d /home/blogger/public_html/
/home/blogger/public_html/ is home directory for basezap FTP user.
- If you want to convert all system (/etc/passwd) accounts to virtual FTP users
pure-pwconvert >> /etc/pureftpd.passwd
- Update the Database
pure-pw mkdb
Now you are ready to connect to FTP server and virtual user using your favourite FTP Client.