Many people new to Unix are running Pure-FTPd because they find it easy to install. But that software is also used on embedded systems and highly loaded production servers, especially for hosting services.
For large sites with centralized user management, Pure-FTPd provides flexible authentication schemes including SQL and LDAP backends, plus the ability to easily write new custom handlers in any language.
As root:
mkdir setups
cd setups
wget http://download.pureftpd.org/pure-ftpd/releases/obsolete/pure-ftpd-1.0.22.tar.gz
tar -xvzf pure-ftpd-1.0.20.tar.gz
cd pure-ftpd-1.0.20 ./configure
make install-strip
The software is now installed in /usr/local/sbin/pure-ftpd
To launch the server, just type the following command:
/usr/local/sbin/pure-ftpd &
First, we create an ftpuser system user and ftpgroup. For many Unix and Unix like systems the command is
groupadd ftpgroup
useradd -g ftpgroup -d /dev/null -s /etc ftpuser
For FreeBSD
pw groupadd ftpgroup
pw useradd ftpuser -g ftpgroup -d /dev/null -s /etc
A quick note on this. You might see an error on startup, either at the console or in /var/log/messages that it can't find the ftp account. This has to do with the -s flag, which disallows anonymous users to download files owned by 'ftp', the anonymous access account. In the pure-ftpd.conf file, it is the AntiWareZ option. The message is harmless, everything still works.
The users we add next will not be in /etc/passwd. Instead, we'll use pure-pw, pure-ftpd's own password database. First we'll add user john
pure-pw useradd john -u ftpuser -d /home/ftpusers/john
We will create a password for him. The -d makes him chrooted. The /home/ftpusers/john directory doesn't have to be created, we're going to configure pure-ftpd to automatically create it when john logs in for the first time.
The pure-pw program reads a database file called pureftpd.pdb (by default). In FreeBSD, it will be created in /usr/local/etc. We'll now create the database.
pure-pw mkdb
Now, we create robert. If we add -m to the pure-pw useradd line, pure-pw will automatically regenerate the database.
pure-pw useradd robert -u ftpuser -d /home/ftpusers/robert -m
Next we look in /etc/ or /usr/local/etc/ in FreeBSD for the pure-ftpd.conf file. In FreeBSD, it is installed as pure-ftpd.conf.sample. Copy it to pure-ftpd.conf.
Most of it can be left at default settings. I make sure that the AnonymousOnly is set to no. I only want authenticated users.
The program can be started from the command line. In my case, I want it running when the system boots. For FreeBSD, it puts a script called pure-ftpd.sh in /usr/local/etc/rc.d and one adds the line
pureftpd_enable="YES"
to /etc/rc.conf. Now the program will run at startup.
Note that the default pure-ftpd.conf file in FreeBSD looks for pureftpd.pdb in /etc rather than /usr/local/etc. Edit your pure-ftpd.conf file and change
PureDB user database (see README.Virtual-Users)
# PureDB /etc/pureftpd.pdb
to read
PureDB user database (see README.Virtual-Users)
PureDB /usr/local/etc/pureftpd.pdb
(The # sign in the default file is also removed, as shown.)
Tidak ada komentar:
Posting Komentar